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]: source.include中加入了 /node_modules[\\/]@vueuse[\\/]/,降级未生效? #3279

Closed
xpc254 opened this issue Aug 25, 2024 · 2 comments
Labels
🐞 bug Something isn't working

Comments

@xpc254
Copy link

xpc254 commented Aug 25, 2024

Version

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400
    Memory: 7.44 GB / 15.34 GB
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.4355
  npmPackages:
    @rsbuild/core: 1.0.1-beta.16 => 1.0.1-beta.16
    @rsbuild/plugin-sass: 1.0.1-beta.16 => 1.0.1-beta.16
    @rsbuild/plugin-vue: 1.0.1-beta.16 => 1.0.1-beta.16

Details

image
为了兼容旧版本浏览器,在source.include中加入了 /node_modules[\/]@vueuse[\/]/,但是实际在旧浏览器运行时,并没有对node_modules中的@vueuse包进行降级,报错如下:
image
之前用0.65版本是可以的,最近升级换了1.0.1-beta.15和16都不能生效,不知道是我配置问题,还是存在bug?

Reproduce link

Reproduce Steps

1、配置source.include中 /node_modules[\/]@vueuse[\/]/,针对旧版浏览器做兼容
2、在谷歌浏览器内核低于63的浏览器上运行,我测试的浏览器内核版本为:
image
3、出现如上面的报错信息,说明并未做降级处理,在0.65版本测试是可以的。

@xpc254 xpc254 added the 🐞 bug Something isn't working label Aug 25, 2024
@chenjiahan
Copy link
Member

请参考 1.0 迁移指南里的 polyfill 变更:https://rsbuild.dev/zh/guide/migration/rsbuild-0-x#%E9%87%8D%E8%A6%81-outputpolyfill

@SoonIter
Copy link
Member

// rsbuild.config.ts
  output: {
    polyfill: 'usage',
  },

https://rsbuild.dev/zh/guide/advanced/browserslist

You can try using rsdoctor for loader analysis and check the transformation result of builtin-swc-loader. If further investigation is needed, please provide a minimal reproducible repository.

@xpc254 xpc254 closed this as completed Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants