openmarco / gulp-systemjs-builder

A tiny wrapper around SystemJS builder .bundle and .buildStatic methods
MIT License
1 stars 7 forks source link

Builder instances are not reusable #1

Open w1ndy opened 7 years ago

w1ndy commented 7 years ago

If I create a builder instance outside a task and use the builder to bundle a directory, the bundled file is not updated as source code changes.

var builder = systemjsBuilder('./', './system.config.js');
gulp.task('bundle', () => {
    return builder
        .bundle('[./dist/**/*.js]')
        .pipe(plugins.rename('bundle.js'))
        .pipe(gulp.dest('./'))
});

Creating a builder every time the task is executed resolves the problem. Is there any way to make the builder reusable across tasks? Seems pretty costly to read the configuration file frequently.