shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.43k stars 186 forks source link

Hash from output.publicPath not replaced #214

Closed maloguertin closed 3 years ago

maloguertin commented 4 years ago

my config:

...
output: {
    path: path.resolve(__dirname, 'public', 'build', '[hash]'),
    publicPath: `${config.get('cdn_domain')}dist/[hash]/`,
  },
...
plugins: [
    new ManifestPlugin({
      fileName: path.resolve(process.cwd(), 'public/build/webpack-assets.json'),
      filter: file => file.isInitial,
    }),
]

expected result:

{
  "index.js": "https:/mycdn.com/dist/f984195aba16fbb15059/index.js
}

actual result:

{
  "index.js": "https:/mycdn.com/dist/[hash]/index.js
}

I know my setup is okay since file-loader properly replaces the URLs in my sass files with the cdn and the hash.

shellscape commented 3 years ago

Fixed by #215