配置对照

add in v3.1.0

结合 webpack chain通过this.store.chainName 可以获取相关配置名,也可以手动根据下面提供名称进行配置 如:

emp.config.ts
import {defineConfig} from '@empjs/cli'
export default defineConfig(store => {
  return {
    chain(config) {
      config.plugin('definePlugin').tap(o => {
        console.log('definePlugin', o)
        return o
      })
    },
  }
})

参考配置

export const chainName = {
  rule: {
    mjs: 'mjs',
    typescript: 'typescript',
    javascript: 'javascript',
    sourceMap: 'sourceMapLoader',
    inline: 'inline',
    svg: 'svg',
    image: 'image',
    font: 'fonts',
    svga: 'svga',
    sass: 'sass',
    less: 'less',
    css: 'css',
  },
  use: {
    swc: 'swc',
    sourceMap: 'sourceMapLoader',
    sass: 'sassLoader',
    less: 'lessLoader',
  },
  plugin: {
    bundleAnalyzer: 'bundleAnalyzerPlugin',
    define: 'definePlugin',
    copy: 'copyRspackPlugin',
    progress: 'progressPlugin',
    empShare: 'empShare',
    html: {
      prefix: 'html-plugin-',
      empSharePrefix: 'html-plugin-empShare-',
      importMapPrefix: 'html-plugin-import-map-',
      hooks: {
        empShareLib: 'HtmlEmpShareLibPluginName',
        importMap: 'HtmlImportMapPlugin',
      },
    },
  },
  minimizer: {
    minJs: 'minJs',
    minCss: 'minCss',
  },
}