Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // html task: move index.html (entry point for the browser) to ./build/
- gulp.task('html', function () {
- return gulp
- .src('src/index.html')
- .on('error', interceptErrors)
- .pipe(gulp.dest('./build/'));
- });
- // default task (this run when you do 'gulp' in the command line)
- // run html and browserify to put all the html+JS into ./build/, then serve the assets
- // in ./build/ to the browser at localhost:4000.
- gulp.task('default', ['html', 'browserify'], function () {
- // serve assets to localhost:4000
- browserSync.init(['./build/**/**.**'], {
- server: './build',
- port: 4000,
- notify: false,
- ui: {
- port: 4001,
- },
- });
- // watch for changes and recompile changed files with html, view, browserify tasks respectively.
- gulp.watch('src/index.html', ['html']);
- gulp.watch(viewFiles, ['views']);
- gulp.watch(jsFiles, ['browserify']);
- });
Advertisement
Add Comment
Please, Sign In to add comment