1.1.2 • Published 2 years ago
@qiwi/module-federation-manifest-plugin v1.1.2
module-federation-manifest-plugin
Webpack plugin to generate manifest about module federation: shared, exposed, remote modules
Install
yarn add -D @qiwi/module-federation-manifest-plugin
npm i -D @qiwi/module-federation-manifest-pluginUsage
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',
}),
],
}Manifest schema
You can find schema description here and real examples in tests
API
Hooks
onManifestCreated
Invokes after manifest created, but not emitted
compiler.hooks.compilation.tap('MyPlugin', (compilation) => {
ModuleFederationManifestPlugin.getHooks(compilation).onManifestCreated.tap('MyPlugin', (manifest) => {
console.log(manifest)
})
})