Skip to content

Instantly share code, notes, and snippets.

@rolaveric
Created January 21, 2015 10:04
Show Gist options
  • Save rolaveric/8b8b608f7ecfa1deb79a to your computer and use it in GitHub Desktop.
Save rolaveric/8b8b608f7ecfa1deb79a to your computer and use it in GitHub Desktop.
Example of how to bundle ES6 modules using systemjs-builder for production
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