Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error occurs when using import with additionalData #4239

Open
xuexb opened this issue Dec 22, 2024 · 0 comments
Open

[Bug]: Error occurs when using import with additionalData #4239

xuexb opened this issue Dec 22, 2024 · 0 comments

Comments

@xuexb
Copy link

xuexb commented Dec 22, 2024

Version

System:
    OS: macOS 15.1.1
    CPU: (12) arm64 Apple M2 Pro
    Memory: 562.38 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 131.0.6778.205
    Edge: 131.0.2903.112
    Safari: 18.1.1
  npmPackages:
    @rsbuild/core: ^1.1.11 => 1.1.11
    @rsbuild/plugin-react: ^1.1.0 => 1.1.0
    @rsbuild/plugin-sass: ^1.1.2 => 1.1.2

Details

场景:

  • 项目中定义 SCSS 变量/方法( src/_var.scss ),并在 additionalData 配置中使用 @use 全局加载
  • 项目依赖三方的样式,使用 @import "xxx" 去加载

现在发现这2个结合时,打包后的产物会把 @use xxx 打包进去。当不使用 @import "xxx" 加载三方时,就没这个问题。

Image

Reproduce link

https://github.com/xuexb/rsbuild-codesandbox-example

Reproduce Steps

  1. nvm use
  2. pnpm install
  3. pnpm build
  4. cat dist/static/css/index.*.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant