AllenYuan

build - build - fin

Apr 22nd, 2020
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // build task: create distribution-ready code. run html to get index.html into ./build/, run browserify
  2. // to get all the JS and HTML templates into ./build/, then minify the JS+templates and move them into
  3. // ./dist/ along with index.html
  4. gulp.task('build', ['html', 'browserify'], function () {
  5.   // pipe index.html to build folder
  6.   var html = gulp.src('build/index.html').pipe(gulp.dest('./dist/'));
  7.   // minify the bundled js and pipe to build folder
  8.   var js = gulp.src('build/main.js').pipe(uglify()).pipe(gulp.dest('./dist/'));
  9.   // return the merged streams
  10.   return merge(html, js);
  11. });
Advertisement
Add Comment
Please, Sign In to add comment