Created
January 21, 2015 10:04
-
-
Save rolaveric/8b8b608f7ecfa1deb79a to your computer and use it in GitHub Desktop.
Example of how to bundle ES6 modules using systemjs-builder for production
This file contains hidden or 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 builder = require('systemjs-builder'), | |
| path = require('path'); | |
| // load SystemJS config from file | |
| builder.loadConfig('./app/system.config.js') | |
| .then(function() { | |
| // Change baseURL to match the file system | |
| builder.config({ baseURL: path.resolve('./app') }); | |
| // Build a self-executing bundle (ie. Has SystemJS built in and auto-imports the 'app' module) | |
| return builder.buildSFX('app', 'app/bundle.js', { minify: true, sourceMaps: true}); | |
| }).catch(function(err) { | |
| console.error(err); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment