ycc*_*eam 6 javascript node.js webpack
我终于让他的dev服务器运行了,我在屏幕上得到了一些东西.我为NPM设置了一个"启动"脚本,如下所示:
"start": "webpack-dev-server --content-base app"
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
http://localhost:8080/bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
Run Code Online (Sandbox Code Playgroud)
我的文件夹设置如下:
appDir
->app
->node_modules
webpack.config.js
package.json
Run Code Online (Sandbox Code Playgroud)
我的webpack.config.js:
module.exports = {
context: __dirname + '/app',
entry: './index.js',
output: {
path: __dirname + '/app',
filename: './bundle.js'
}
}
Run Code Online (Sandbox Code Playgroud)
你能说出什么问题吗?
bundle.js位于您的/app目录中.path输出中的该选项指定文件的绝对路径.
此外,您不需要./文件名.它会得到相对解决output.path但却令人困惑,可能会导致您的问题.
| 归档时间: |
|
| 查看次数: |
17478 次 |
| 最近记录: |