From 01e14bdc78e8235e21dedc40a1db4fd30b8c55b3 Mon Sep 17 00:00:00 2001 From: SevereOverfl0w Date: Sun, 20 Sep 2015 14:40:28 +0100 Subject: [PATCH] Add a browserify local function This function auto-injects the file built by the browserify extension. --- lib/index.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/index.coffee b/lib/index.coffee index b7838f0..1036d72 100644 --- a/lib/index.coffee +++ b/lib/index.coffee @@ -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 = '') -> + "\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.