Skip to content

Webpack plugin to generate manifest about module federation: shared, exposed, remote modules

License

Notifications You must be signed in to change notification settings

qiwi/module-federation-manifest-plugin

Repository files navigation

module-federation-manifest-plugin

CI Maintainability Test Coverage npm (tag)

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-plugin

Usage

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)
  })
})

License

MIT

About

Webpack plugin to generate manifest about module federation: shared, exposed, remote modules

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •