Webpack4代码拆分重复错误

时间:2018-08-15 13:39:14

标签: javascript node.js webpack webpack-4 code-splitting

module.exports = {
  entry: {
    vendors: "./src/vendor",
    main: "./src/index.js",
    auth: "./src/auth.js",
    search: "./src/search.js",
    cinema: "./src/cinema.js"
  },
optimization: {
    splitChunks: {
      cacheGroups: {
        vendors: {
          test: /[\\/]node_modules[\\/]/,
          name: "vendors",
          chunks: "all"
        }
      },
    },
    runtimeChunk: "single",
  }

这很好。但是Cinema.js和main.js的块具有重复的条目。请帮助我如何避免它。 我需要将重复的代码从Cinema.js移到main.js

0 个答案:

没有答案