write-microfrontend-descriptor-json
v2.0.0
Published
adapted version of [write-json-webpack-plugin] for write compiled hash into output json
Downloads
13
Readme
Write Microfrontend Descriptor Json Plugin
Emits a JSON file that contains data passed through to it. Adds compiled hash.
Use Case
This NPM package is used to create an info.json file. An info.json file is used to load widgets as micro frontend. We are using this repository to assemble different widgets: https://github.com/spring-media/la-microfrontend-core
Its in use in (Meine Welt App)[https://github.com/spring-media/la-mw-app] to load different widgets.
Version
Please note that version > 2.x is only compatible with webpack 5. If your project is using webpack 4 please use a version < 2.
Usage
// Add to your Webpack config file
var path = require('path');
var WriteDescriptorJsonPlugin = require('write-microfrontend-descriptor-json');
module.exports = {
plugins: [new WriteDescriptorJsonPlugin()]
};
new WriteDescriptorJsonPlugin({
object: [object],
path: 'public',
// default output is info.json
filename: 'info.json',
pretty: true
})
Release
To release a new version make sure you are on the main branch after merging your feature and run:
npm run release