Skip to content

[Bug]: The builtin loaders should not pass meta to the next loader #7819

@chenjiahan

Description

@chenjiahan

System Info

Rspack 1.0.3

Details

In webpack, the meta param of loader can only be passed to the next loader, and the bulitin loaders in Rspack should follow the same behavior.

https://webpack.js.org/api/loaders/#thiscallback

Example

For example, the css-loader and postcss-loader uses meta.ast to resue PostCSS AST, see:

When using Rspack's builtin:lightningcss-loader like this:

postcss-loader ---passing AST meta---> builtin:lightningcss-loader ---passing AST meta---> css-loader

The builtin:lightningcss-loader will not take any effect, because css-loader will read the AST meta from postcss-loader, and drop the transformation result of builtin:lightningcss-loader.

Reproduce link

web-infra-dev/rsbuild#3247

Reproduce Steps

See web-infra-dev/rsbuild#3247 for more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingteamThe 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