nwb build-react-app creates root path rather than relative path

前端 未结 1 1640
傲寒
傲寒 2021-01-24 07:17

I am testing out nwb to streamline building react apps using this example project. While the app is built, the path of css and js files referenced in index.html are in root rath

相关标签:
1条回答
  • 2021-01-24 07:56

    You can use webpack.publicPath in your nwb.config.js file for this:

    If you want to create a path-independent build, set publicPath to blank:

    module.exports = {
      webpack: {
        publicPath: ''
      }
    }
    

    Source: https://github.com/insin/nwb/blob/master/docs/Configuration.md#publicpath-string

    0 讨论(0)
提交回复
热议问题