Skip to content

[Feature]: DefinePlugin support __webpack_layer__ #7848

@luhc228

Description

@luhc228

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__'
    }) 
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featNew feature or requestteamThe issue/pr is created by the member of Rspack.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions