speed-measure-webpack-plugin icon indicating copy to clipboard operation
speed-measure-webpack-plugin copied to clipboard

"PUBLIC_URL" no parse

Open qwerchuan opened this issue 4 years ago • 4 comments

URIError: Failed to decode param '/%PUBLIC_URL%/favicon.ico'

qwerchuan avatar Sep 07 '21 02:09 qwerchuan

Same problem here (1.5.0). After wrapping webpack config with smp.wrap as described in Usage, %PUBLIC_URL% in index.html is not replaced as it should.

jobh avatar Sep 20 '21 11:09 jobh

Current workaround is to make it conditional in build.js,

if (process.env.MEASURE_BUILD) {
  ...wrap...
}

and don't use the measured builds for anything (except measuring of course).

jobh avatar Sep 20 '21 11:09 jobh

All environment variables are not parsed in template html is my minimal GitHub repository to show this https://github.com/hellokidder/webpack-bundle-analyzer-test

hellokidder avatar Nov 09 '21 03:11 hellokidder

Same issue here with %PUBLIC_URL%. I'd like to use the SMP wrapper in production to remove the CRA default "IgnorePlugin" for the popular library Method.js that has huge locale files because I don't use it.

Is there any solution to get both of them working ? Maybe removing the 2 plugins before wrap and adding them manually after wrap ?

        shouldInlineRuntimeChunk &&
        new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime-.+[.]js/]),
      // Makes some environment variables available in index.html.
      // The public URL is available as %PUBLIC_URL% in index.html, e.g.:
      // <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
      // It will be an empty string unless you specify "homepage"
      // in `package.json`, in which case it will be the pathname of that URL.
      new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw),```

Ricola3D avatar Nov 15 '21 15:11 Ricola3D