Webpack plugin to generate manifest about module federation: shared, exposed, remote modules
yarn add -D @qiwi/module-federation-manifest-plugin
npm i -D @qiwi/module-federation-manifest-plugin
Add plugin to webpack config. This plugin works together with ModuleFederationPlugin
. In case of usage without it error will be raised
import webpack from 'webpack'
import path from 'path'
import { ModuleFederationManifestPlugin } from '@qiwi/module-federation-manifest-plugin'
export const config: webpack.Configuration = {
plugins: [
new webpack.container.ModuleFederationPlugin({
/** Your options here */
}),
new ModuleFederationManifestPlugin({
filename: 'manifest.json',
}),
],
}
You can find schema description here and real examples in tests
Invokes after manifest created, but not emitted
compiler.hooks.compilation.tap('MyPlugin', (compilation) => {
ModuleFederationManifestPlugin.getHooks(compilation).onManifestCreated.tap('MyPlugin', (manifest) => {
console.log(manifest)
})
})