Systemjs bundle

50 views Asked by At

I am trying to create a bundle for my app files in Angular 5. I have the below gulp tasks. The "app-compile" seems to be running fine but "app-bundle" runs but doesn't create any folder or file. What I am missing here?

gulp.task('app-compile', function () {
    return gulp.src('./tsscripts/**/*.ts')
        .pipe(sourcemaps.init())
        .pipe(tsc({
            "target": 'es5',
            "module": 'commonjs',
            "moduleResolution": 'node',
            "lib": ['es2015', 'dom', 'es2015.iterable'],
            "sourceMap": true,
            "emitDecoratorMetadata": true,
            "experimentalDecorators": true,
            "removeComments": true,
            "noImplicitAny": false
        }))
        .pipe(sourcemaps.write({ sourceRoot: 'dist' }))
        .pipe(gulp.dest('dist'));

});

gulp.task('app-bundle', gulp.series('app-compile'), function () {
    var builder = new systemjsBuilder('', './scripts/systemjs.config.js');

    return builder
        .bundle('./dist/**/*', 'bundles/app.bundle.js', {
            minify: false,
            mangle: false,
            sourceMaps: true 
        })
        .then(function (bundle) {
            console.log('Build complete' + bundle);
        })
        .catch(function (err) {
            console.log('Build error');
            console.log(err);
        });
});
0

There are 0 answers