0.0.1 • Published 2 years ago

@fawkesjs/module-index-export-plugin v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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

2 years ago