【发布时间】:2017-06-28 12:22:47
【问题描述】:
我是 laravel 的新手,以前我主要是在 node.js 上。
我们在一个新项目中使用 react 和 laravel。当我看到这个文件时我很困惑https://github.com/eriksape/laravel-react-hot-loader/blob/master/gulpfile.js
为什么在 gulpfile.js 中使用 elixir?我以为我们可以像这样吞咽下去
gulp.task('watch', function() {
browserSync({
proxy: 'localhost:8000',
middleware: [
webpackDevMiddleware(bundler, {
publicPath: webpackConfig.output.publicPath,
stats: { colors: true }
}),
webpackHotMiddleware(bundler)
]
});
});
但我确实尝试过使用纯 gulp,热重载不起作用,webpack 将重新从头开始打包所有内容。不知道长生不老药在这里起到什么作用。
【问题讨论】: