AllenYuan

build - default - 2

Apr 22nd, 2020
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // default task (this run when you do 'gulp' in the command line)
  2. // run html and browserify to put all the html+JS into ./build/, then serve the assets
  3. // in ./build/ to the browser at localhost:4000.
  4. gulp.task('default', ['html', 'browserify'], function () {
  5.   // serve assets to localhost:4000
  6.   browserSync.init(['./build/**/**.**'], {
  7.     server: './build',
  8.     port: 4000,
  9.     notify: false,
  10.     ui: {
  11.       port: 4001,
  12.     },
  13.   });
  14.  
  15.   // watch for changes and recompile changed files with html, view, browserify tasks respectively.
  16.   gulp.watch('src/index.html', ['html']);
  17.   gulp.watch(viewFiles, ['views']);
  18.   gulp.watch(jsFiles, ['browserify']);
  19. });
Advertisement
Add Comment
Please, Sign In to add comment