HtmlWebpackPlugin injects relative path files which breaks when loading non-root website paths

后端 未结 3 1999
無奈伤痛
無奈伤痛 2020-12-02 12:31

I am using webpack and the HtmlWebpackPlugin to inject bundled js and css into an html template file.

new HtmlWebpackPlugin({
   template: \'client/index.tpl         


        
3条回答
  •  离开以前
    2020-12-02 13:07

    in webpack config

    config.output.publicPath = ''
    

    in your index.html

    
    

    this should do it.

提交回复
热议问题