Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('build', function (done) {
gulp_util.log('Building source files');
es
.merge(Object.keys(sources).map(function (n) {
return build_app_sources(n, true);
}))
.pipe(es.wait(function (err, body) {
gulp_util.log('Collecting static files');
run('./manage.py collectstatic --noinput')
.exec('', function (err) { done(err); });
}));
});
gulp.task('build-prod', ['build.lib'], function () {
var tsProject = typescript.createProject('./tsconfig.json', { typescript: require('typescript') });
var tsSrcInlined = gulp.src([webroot + '**/*.ts'], { base: webroot })
.pipe(inlineNg2Template({ base: webroot }));
return eventStream.merge(tsSrcInlined, gulp.src('Typings/**/*.ts'))
.pipe(sourcemaps.init())
.pipe(typescript(tsProject))
.pipe(sourcemaps.write())
.pipe(gulp.dest(webroot));
});
gulp.task('bundle', function () {
tagsStream = gulp.src('./src/**/*.tag')
.pipe(riot({brackets:'{{ }}'}));
es6Stream = gulp.src('./src/**/*.es6');
eventStream.merge(tagsStream, es6Stream)
.pipe(concat('riot-mui.js'))
.pipe(babel({presets:['es2015']}))
.pipe(minify())
.pipe(sourcemaps.write())
.pipe(gulp.dest('./build/js'));
});
gulp.task('js', function(){
var jssrc = gulp.src((env.p) ? 'src/js/**/*.js' : ['src/js/**/*.js', '!src/js/analytics.js']);
var tssrc = gulp.src(['src/js/**/*.ts'])
.pipe(ts({
noImplicitAny: true,
target: 'es5',
lib: ['dom', 'scripthost', 'es5', 'es2015.core'],
module: 'commonjs'
}));
return merge(jssrc, tssrc)
.pipe(plumber())
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest('assets/js/'));
});
gulp.task("default", function() {
eventStream
.merge(
gulp.src("almond.js"),
gulp
.src("*.js")
.pipe(amdOptimize("main"))
.pipe(concat("main-bundle-modules.js"))
)
.pipe(order(["almond.js", "main-bundle-modules.js"]))
.pipe(concat("main-bundle.js"))
.pipe(gulp.dest("."));
});