rspack icon indicating copy to clipboard operation
rspack copied to clipboard

[Feature]: DefinePlugin support `__webpack_layer__`

Open luhc228 opened this issue 5 months ago • 1 comments

What problem does this feature solve?

Webpack supports __webpack_layer__ and it will be replaced with the value of entry.layer. But now Rspack doesn't support it.

What does the proposed API of configuration look like?

// webpack.config.js
module.exports = {
  entry: {
    catalog: {
      import: './catalog.js',
      layer: 'main'
    }
  },
  plugins: [
     new rspack.DefinePlugin({
      __RUNTIME_TYPE__: '__webpack_layer__'
    }) 
  ]
}

luhc228 avatar Sep 10 '24 05:09 luhc228