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

后端 未结 3 2001
無奈伤痛
無奈伤痛 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 fact, I had to put :

    output.publicPath: './';
    

    in order to have it working in a non-ROOT path. At the same time I was injecting :

       baseUrl: './'
    

    into

    
    

    With both parameter set, it worked like a charm.

提交回复
热议问题