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]: circular dependency problem #5928

Closed
jayjliang opened this issue Mar 13, 2024 · 4 comments
Closed

[Bug]: circular dependency problem #5928

jayjliang opened this issue Mar 13, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@jayjliang
Copy link

Version

System:
    OS: macOS 14.2.1
    CPU: (12) arm64 Apple M2 Pro
    Memory: 83.97 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 122.0.6261.112
    Safari: 17.2.1
    Safari Technology Preview: 17.4
  npmPackages:
    @rsbuild/core: ^0.4.14 => 0.4.15 
    @rsbuild/plugin-node-polyfill: ^0.4.14 => 0.4.15 
    @rsbuild/plugin-react: ^0.4.14 => 0.4.15 
    @rsbuild/plugin-styled-components: ^0.4.15 => 0.4.15

Details

webpack5 build is ok, but rspack will cause circular dependency problem, the reason is that webpack5 will change import { defineLocale } from 'packageA' to import { defineLocale } from './src/locale.js', but rspack will not, so circular dependency problem occur

ps: webpack4 is also not ok

i wonder if there has some option to make this behavior same as webpack

Reproduce link

https://github.com/jayjliang/rsbuild-demo

Reproduce Steps

yarn
cd ./packages/package-b
yarn dev
yarn dev:webpack

@chenjiahan chenjiahan transferred this issue from web-infra-dev/rsbuild Mar 13, 2024
@chenjiahan chenjiahan added the bug Something isn't working label Mar 13, 2024
@hardfist
Copy link
Contributor

hardfist commented Mar 13, 2024

newTreeshaking solve this problem,try it

@jayjliang
Copy link
Author

newTreeshaking solve this problem,try it

ok, already try newTreeshaking, but the build time increase from 10s to 1.46min, I will use some tools like Rsdoctor to analyse the build time

@IWANABETHATGUY
Copy link
Contributor

Do you mean the same repo?

@IWANABETHATGUY IWANABETHATGUY self-assigned this Mar 13, 2024
@IWANABETHATGUY
Copy link
Contributor

Please file another issue if the problem couold not be solved.

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

4 participants