webpack hrm 问题
Closed this issue · 9 comments
ptphp commented
/app.js
if(debug) {
var webpackDevMiddleware = require('koa-webpack-dev-middleware');
var webpack = require('webpack');
var webpackDevConf = require('./webpack-dev.config');
app.use(webpackDevMiddleware(webpack(webpackDevConf), {
contentBase: webpackDevConf.output.path,
publicPath: webpackDevConf.output.publicPath,
hot: true,
// stats: webpackDevConf.devServer.stats
stats: {
cached: false,
colors: true
}
}));
}
hot: true 是开启HMR么?修改后好像不能更新
chemdemo commented
不用修改啊会本来就会自动更新的
ptphp commented
我是用的REACT,把JSXLOAD 接成BABEL,好像不能自动更新了
yatelu1 commented
我在win下node-dev没反应,后来换成nodemon就好了 很妖的问题
liupy525 commented
我把项目git clone下来后,执行npm run start-dev,然后修改a.css,能看到terminal里在增量打包,但是网页不会自动更新额。。。是这样的么????
liupy525 commented
soga 明白了 谢谢哈~
jypblue commented
请问为什么我直接npm run start-dev 点开测试demo a.html发现现实a.js的require关键字提示未定义,如果写react或者es6需要预编译什么么?不然无法执行。
jypblue commented
对的,谢谢,后来发现是node-sass报错的缘故。