npm install single-spa-asset-webpack-plugin --save-dev
const SingleSpaAssetWebpackPlugin = require("single-spa-asset-webpack-plugin");
new SingleSpaAssetWebpackPlugin(
{
output:"config.json",
config: {
"main": ""
},
beforeWrite: (config,assetObj)=>{
// asseet obj asset files
return config
},
afterWrite: (config,path)=>{
}
}
)
You can custom child module config params, e.g
Configuration Params
Param | Desc | default |
---|---|---|
output | single spa config path | single.spa.json |
config | single spa config obj (content) | config |
beforeWrite | function must be return config | empty function |
isOverride | if true else override config | true |
afterWrite | config write after | empty function |
{
"main": ""
}
{
"main": "app.a4a96aebc315cd042a48.bundle.js"
}