我终于成功启动了开发服务器,并在屏幕上看到了一些东西。 我已经像这样为 NPM 设置了一个“start”脚本:
"start": "webpack-dev-server --content-base app"
我遇到了一个错误:
http://localhost:8080/bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
我的文件夹设置如下:
appDir
->app
->node_modules
webpack.config.js
package.json
我的webpack.config.js文件:
module.exports = {
context: __dirname + '/app',
entry: './index.js',
output: {
path: __dirname + '/app',
filename: './bundle.js'
}
}
你能说出哪里有问题吗?