Created
February 22, 2015 06:15
-
-
Save jearle/1f29848b1c09e7548bf3 to your computer and use it in GitHub Desktop.
Brocfile.js to babel transpile and browserify your ES6 code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pickFiles = require('broccoli-static-compiler'); | |
var fastBrowserify = require('broccoli-fast-browserify'); | |
var babelTranspiler = require('broccoli-babel-transpiler'); | |
var mergeTrees = require('broccoli-merge-trees'); | |
var libTree = pickFiles('lib', { | |
files: ['**/*.js'], | |
srcDir: '.', | |
destDir: './assets' | |
}); | |
var babelTree = babelTranspiler(libTree, { sourceMap: 'inline' }); | |
var browserifyTree = fastBrowserify(babelTree, { | |
bundles: { | |
'browserify.js': { | |
entryPoints: ['./assets/index.js'] | |
} | |
}, | |
browserify: { | |
debug: true | |
} | |
}); | |
module.exports = mergeTrees(['./templates', browserifyTree]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment