//webpack.config.js
devtool: 'eval-source-map',
entry: __dirname + "/component/index.js",
output:{
path:__dirname+'/bundle',
filename:'bundle.js'
},
devServer:{
colors:true,
historyApiFallback:true,
inline:true,
hot:true,
port:9000
},
//package.json
"start": "webpack-dev-server --inline --hot --content-base"
文件目录如下
//index.html
Title
我发现每次修改文件后终端会显示重新打包 是不是html引入有问题?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
为啥没用?没用的表现是啥?
先确定自己webpack-dev-server这个插件下载没。。
然后在config.js中,加
看你的配置
webpack.config.js文件好像确实一些必要的配置,你可以这样配置文件试试,记得在入口文件配置
'webpack/hot/dev-server'