慕粉3828685
2018-01-29 10:19
path = require()
= require()
= require()
isDev = process..=== config = {
: : path.(__dirname): {
: : path.(__dirname)
}: {
: [
{
: : }{
: : [
]
}{
: : [
]
}{
: : [
{
: : {
: : }
}
]
}]
}: [
.DefinePlugin({
: {
: isDev ? : }
})()]
}
(isDev) {
config.= config.= {
: : : {
: }: }
config..(
.HotModuleReplacementPlugin().NoEmitOnErrorsPlugin()
)
}
.= config
把hot:true 注释掉!
和楼主同样的问题,请问解决了吗?
config.plugins.push(
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
)
我直接将
new webpack.HashedModuleIdsPlugin() 添加到 webpack 的plugins中
== 这样 开发和生产环境就没区别了... 不知道为什么 push 没成功
视频中hot=true注释掉了
我的一样的问题,代码如下:
if(isDev){
config.devtool = "#cheap-module-eval-source-map"
config.devServer = {
port:8000,
host:'0.0.0.0',
overlay:{
errors:true,
},
// open:true,
hot:true
}
config.plugins.push(
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
)
}
贴一下代码
Vue+Webpack打造todo应用
84618 学习 · 812 问题
相似问题