Skip to content

Commit

Permalink
Add a browserify local function
Browse files Browse the repository at this point in the history
This function auto-injects the file built by the browserify extension.
  • Loading branch information
SevereOverfl0w committed Sep 21, 2015
1 parent 2f84cba commit 98b1290
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,16 @@ module.exports = (opts) ->
@b.on 'package', (pkg) =>
@pkg_cache[path.join(pkg.__dirname, 'package.json')] = pkg

@roots.config.locals ?= {}
@roots.config.locals.browserify = (prefix = '') ->
"<script src='#{prefix}#{opts.out}'></script>\n"


@b.transform(t) for t in opts.transforms
if opts.minify then @b.transform(uglifyify, { global: true })



###*
* Gets the dependency graph of required files so we can ignore them
* from the compile process.
Expand Down

0 comments on commit 98b1290

Please sign in to comment.