gem-mine / webpack-css-themes-plugin

7 stars 2 forks source link

配置加了WebpackCSSThemesPlugin之后,webpack5 ModuleFederationPlugin插件失效运行报错 #10

Open zhangqcoder opened 3 years ago

zhangqcoder commented 3 years ago

webpack依赖如下: "webpack": "5.35.1", "webpack-bundle-analyzer": "^4.4.0", "webpack-cli": "4.6.0", "webpack-css-themes-plugin": "^0.12.3", "webpack-dev-server": "3.11.2", "webpack-merge": "^5.7.3"

node -v : 14.16.0

添加 WebpackCSSThemesPlugin 之后,报错信息是 image

代码如下: plugins: [ new webpack.ProvidePlugin({ process: 'process/browser', }),

new ModuleFederationPlugin({
  name: 'base',
  filename: 'remoteEntry.js',
  exposes: {
    './cmp': './src/components/cmpSourceMap.js',
    './config': './src/config/index.js',
    './store': './src/store/index.js',
    './http': './src/utils/http.js',
    './auth': './src/utils/auth.js',
    './theme': './src/utils/theme.js',
  },
}),
new CopyWebpackPlugin({
  patterns: [
    {
      from: './cdn',
      to: './libs',
      toType: 'dir',
    },
  ],
}),
new VueLoaderPlugin(),
new WebpackCSSThemesPlugin({
  themes: [
    {
      name: 'default',
      entryPath: path.resolve(__dirname, '../src/element-variables.scss'),
    },
  ],
}),
new HtmlWebpackPlugin({
  title: 'xxxxx',
  filename: './index.html',
  template: './src/template/index.ejs',
  favicon: path.resolve(__dirname, '../src/template/favicon.ico'),
  excludeAssets: [/\.css$/],
  cdnURL: EXTERNALS_CDN_URL(),
  inject: true,
}),

new ExcludeAssetsPlugin(),

],

githoniel commented 3 years ago

未测过webpack5兼容

githoniel commented 3 years ago

@zhangqcoder webpack5兼容已发布,请使用2.0.0