我正在测试nwb以简化构建反应应用程序,使用这个例子项目。在构建应用程序时,index.html中引用的css和js文件的路径是根文件,而不是相对路径。有什么办法改变引用吗?
例如:
在html中,引用如下,
<script type="text/javascript" src="/vendor.b3f34f12.js"></script>
<script type="text/javascript" src="/app.9b5c57d3.js"></script> 而不是,
<script type="text/javascript" src="./vendor.b3f34f12.js"></script>
<script type="text/javascript" src="./app.9b5c57d3.js"></script> 发布于 2016-09-12 00:17:37
您可以在您的webpack.publicPath文件中使用nwb.config.js:
如果要创建独立于路径的生成,请将
publicPath设置为空: module.exports ={ webpack:{ publicPath:'‘}
来源:https://github.com/insin/nwb/blob/master/docs/Configuration.md#publicpath-string
https://stackoverflow.com/questions/39441825
复制相似问题