1 year ago

#376123

test-img

NeoZoom.lua

What's the idea of "layer" in Webpack 5?

As title. I'm learning Webpack 5, and I just noticed there seems to be a concept called "layer" that is rarely mentioned(or I haven't found) in the documentation. It can be found here (for the intro. of top-level entry field):

    personal: {
      // ...
      layer: 'name of layer', // set the layer for an entry point
    },
  },
};

and here (for the built-in plugin SplitChunksPlugin):

splitChunks.cacheGroups.{cacheGroup}.layer

Assign modules to a cache group by module layer.

Are these two layers have the same meaning? If not, what are the definitions? Could you also point out the advantage(s) of using them? (I don't even know how to use it... at all)

webpack

webpack-5

0 Answers

Your Answer

Accepted video resources