A
A
amiznikov2019-06-25 11:30:47
JavaScript
amiznikov, 2019-06-25 11:30:47

How to merge chunk and bundle correctly?

Hello everyone, in short, I want to combine the bundle and the chunk, i.e. I put all the necessary node_modules in one bundle and the main code there, it turns out something like this:

webpackConfig.entry = {
{
   "core": "./src/app/main.js",
   "entryA": "./src/chunkA/chunkA.js",
   "entryB": "./src/chunkB/chunkB.js"
}

module.exports = {
  optimization: {
    splitChunks: {
      cacheGroups: {
        default: false,
        core: {
          name: 'core',
          chunks: 'all',
          test: /node_modules/,
        }
      }
  }
}

Schematically something like this, but the problem is that if I specify that all node modules fit in the core bundle, then the bundle turns into a chunk. How to avoid this and how to make the bundle remain a bundle? Thanks to all!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question