0.1.1-alpha.1 • Published 2 years ago
@ljweb/qiankun-external-assets-webpack-plugin v0.1.1-alpha.1
@ljweb/qiankun-external-assets-webpack-plugin
to use "html-webpack-tags-plugin" to add external assets to html and "webpack-manifest-plugin" to generate manifest.json file in main project .
read manifest.json file from remote in sub project to compare and add ignore attribute.
In main project
const QiankunExternalAssetsWebpackPlugin = require('@ljweb/qiankun-external-assets-webpack-plugin');
configureWebpack: (config) => {
config.plugin.push(new QiankunExternalAssetsWebpackPlugin(
// options: HtmlWebpackTagsPluginOptions & ManifestPluginOptions
{ ... }
)
}
In sub project
const QiankunExternalAssetsWebpackPlugin = require('@ljweb/qiankun-external-assets-webpack-plugin/sub');
configureWebpack: (config) => {
config.plugin.push(new QiankunExternalAssetsWebpackPlugin{
// remote manifest.json url
url: '{remote domain}manifest.json',
// customized match function
match: (path:string, externals: Record<string,string>)=>{
return boolean;
}
})
}