How webpack-assets-manifest plugin defines names of assets? #267
-
Hi, in my project i use webpack with module federation plugin and webpack-assets-manifest plugin webpack-assets-manifest plugin works properly but i dont undesrtand how it defines "original" names of assets For example i use Module Federation plugin with defined option new webpack.container.ModuleFederationPlugin({
name: "foobar",
filename: "remote-entry.js",
exposes: {
"./Header": "./src/components/header/index.tsx",
},
}), but in assets manifest i see this: {
"foobar.js": "remote-entry.js",
"remote-entry.js.map": "remote-entry.js.map",
// ...some other assets
} Keys of manifest object for remote entry relative assets are little bit inconsistent How webpack-assets-manifest plugin or maybe webpack itself defines names of assets? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@krutoo I've not used Can you create minimal reproducible example that I can clone so I can try some things? |
Beta Was this translation helpful? Give feedback.
@krutoo I get data from
compilation.getAssets()
and use that to determine what goes in the assets manifest. Some assets do not haveinfo.sourceFilename
since they are generated files. In that case, I use thename
reported fromgetAssets()
.webpack-assets-manifest/src/WebpackAssetsManifest.js
Line 524 in dde2bc3
webpack-assets-manifest/src/WebpackAssetsManifest.js
Lines 574 to 576 in dde2bc3