@fawkesjs/module-index-export-plugin
v0.0.1
Published
创建一个@/modules下的所有vue文件的索引文件
Readme
module-index-export-plugin
它会在moduleIndexFile位置创建一个文件索引,索引包含@/modules下的所有vue文件
使用方法
Host webpack.config
const ModuleIndexExportPlugin = require('@fawkesjs/module-index-export-plugin')
const moduleIndexFile = './customFileName.js'
const config = {
...otherConfigs
plugins: [
new ModuleIndexExportPlugin({
filePath: path.resolve(__dirname, `${moduleIndexFile}`)
}),
...otherPlugins
]
}模块联邦配合使用
Host webpack.config
const ModuleIndexExportPlugin = require('@fawkesjs/module-index-export-plugin')
const ModuleFederationPlugin = require('webpack').container.ModuleFederationPlugin
const moduleIndexFile = './customFileName.js'
const config = {
...otherConfigs
plugins: [
new ModuleIndexExportPlugin({
filePath: path.resolve(__dirname, `${moduleIndexFile}`)
}),
new ModuleFederationPlugin({
exposes: {
'./Modules': `${moduleIndexFile}`
},
...otherModuleFederationPluginConfig
})
]
}