Webpack:仅在拆分为大块时才打包

我有以下文件:

import "core-js/stable";
import "regenerator-runtime/runtime";
import "core-js/proposals/reflect-metadata";

// ... other setting codes

使用webpack的SplitChunkPlugin,我可以创建仅包含'core-js'和'regenerator-runtime'的块。

module.exports = {
  //...
  optimization: {
    splitChunks: {
      cacheGroups: {
        vendor: {
          test: /[\\/]node_modules[\\/](core-js|regenerator-runtime)[\\/]/,name: 'vendor',chunks: 'all',}
      }
    }
  }
};

但是,在我的应用程序中,我只需要这两个软件包的一部分,即core-js/stablecore-js/proposals/reflect-metadata,而其他所有部分都是不必要的。有没有办法设置webpack,使我的块中只包含我需要的部分?

fandongdong888 回答:Webpack:仅在拆分为大块时才打包

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3104610.html

大家都在问