在我看过的所有示例中,入口点html文件(例如index.html)与webpack发出的所有构建资产一起存在.
build/
index.html
bundle.js
1.bundle.js
2.bundle.js
etc
Run Code Online (Sandbox Code Playgroud)
我想将我的入口点html与构建的资源分开:
index.html
build/
bundle.js
1.bundle.js
2.bundle.js
etc
Run Code Online (Sandbox Code Playgroud)
这是webpack的可能吗?
Pas*_*cal 12
啊哈,想通了.在webpack.config中,您必须设置output.publicPath.该路径用于为CSS中的所有相对URL添加前缀.
就我而言,我用过:
output: {
path: path.resolve('./build'),
publicPath: './build/',
filename: '[name].bundle.js'
},
Run Code Online (Sandbox Code Playgroud)
http://webpack.github.io/docs/configuration.html#output-publicpath
| 归档时间: |
|
| 查看次数: |
9407 次 |
| 最近记录: |