Skip to content

Instantly share code, notes, and snippets.

@tjclement
Created January 6, 2016 11:42
Show Gist options
  • Save tjclement/7d6e606b2ba4411ced51 to your computer and use it in GitHub Desktop.
Save tjclement/7d6e606b2ba4411ced51 to your computer and use it in GitHub Desktop.
Example repro for a SystemJS build issue when using Babel
/**
* Assumes jspm's config.js contains configs to use Babel as the transpiler.
*/
var DevBuilder = require('jspm-dev-builder');
var path = require('path');
var ipc = require('ipc-light');
var fs = require('fs');
var appBuilder = new DevBuilder({
expression: path.join(__dirname, '..', 'src', 'main'),
outLoc: path.join(__dirname, '..', 'www', 'dev.js'),
logPrefix: 'my-app',
buildOptions: {
minify: false,
mangle: false,
sourceMaps: true
}
});
appBuilder.build().then(function () {
console.log('App has been fully built, and is functional.');
fs.appendFileSync('src/controllers/HomeController.js', '\n');
appBuilder.build('src/controllers/HomeController.js').then(function(){
console.log('App has been partially rebuilt, and is still functional.');
fs.appendFileSync('src/controllers/HomeController.js', '\n');
appBuilder.build('src/controllers/HomeController.js').then(function(){
console.log('App is broken now, run www/dev.html to see error message.');
process.exit(0);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment