shellscape / webpack-manifest-plugin

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

Add an option to configure where should be save the manifest.json #299

Closed RodrigoTomeES closed 1 year ago

RodrigoTomeES commented 1 year ago

Feature Use Case

I am using this plugin to implement the Facade Pattern for heavy components in NextJS. How? I import the manifest and read the key of my chunk to preconnect with it.

Why I need this feature? Because in NextJS the manifest should be in /public and by the default the plugin save the manifest in .next folder.

Feature Proposal

An option to set the path where the file should be saved.

Thanks!

erropix commented 1 year ago

You can use option fileName with an absolute path like

new WebpackManifestPlugin({
    fileName: path.join(__dirname, 'relative/path/to/manifest.json')
})