A tiny wrapper around SystemJS builder .bundle
and .buildStatic
methods. Based on SystemJS Builder. It allows use .pipe()
method on output after build.
var systemjsBuilder = require('gulp-systemjs-builder')
gulp.task('build-sjs', function () {
var builder = systemjsBuilder()
builder.loadConfigSync('./system.config.js')
builder.buildStatic('app/main.js', {
minify: false,
mangle: false
})
.pipe(gulp.dest('./build'));
})
To create instance of plugin use systemjsBuilder(baseURL, configFile)
. Works transperent to original SystemJS Builder.
var builder = systemjsBuilder('./', './system.config.js')
You can't return pipe from .loadConfig().then()
method, so use .loadConfigSync
to initialize systemjs.config from external file.
builder.loadConfigSync('./system.config.js')
All other options works exactly as in SystemJS Builder.
You can use .bundle
and .buildStatic
methods like you do it in SystemJS Builder:
builder.buildStatic('myModule.js', 'outfile.js', options);
If you not set the outputfile, gulp-systemjs-builder will try to use your input filename. When you not set the output file and use arithmetic expressions in input filename, gulp-systemjs-builder will use default output filename build.js
Original SystemJS Builder methods aliased to ._bundle()
and ._buildStatic()