我已经成功编写了此代码,它以bash执行,但是没有启动浏览器。任何帮助表示赞赏。
注释掉的代码和未注释的bash启动都很好,但是我从没有chrome打开我的html文件。铬如何打开?我想念什么吗?
Toshiba Laptop@ToshibaLaptop MINGW64 ~/Desktop/Projects/trave-site (master)
$ gulp watch
[14:48:50] Using gulpfile ~\Desktop\Projects\trave-site\gulpfile.js
[14:48:50] Starting 'watch'...
[14:48:50] Finished 'watch' after 26 ms
[Browsersync] Access URLs:
-----------------------------------
Local: http://localhost:3000
External: http://10.0.0.235:3000
-----------------------------------
UI: http://localhost:3001
UI External: http://10.0.0.235:3001
-----------------------------------
[Browsersync] Serving files from: ./app
//gulp.task('browser-sync', function() { // this works if uncomented
// browserSync.init({
// server: {
// baseDir: "./"
// }
// });
//});
gulp.task('watch', function(){
browserSync.init({ // this works as well neither launch chrome
server : {
baseDir: "./app",
index: "index.html"
}
});
});