-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
refactor: break circular dependencies to fix test-unit #18237
refactor: break circular dependencies to fix test-unit #18237
Conversation
…/environment.ts` breaks the following circular dependecy: config.ts -> server/environments/runnableEnvironment.ts -> server/environment.ts -> config.ts
breaks the following circular dependency: server/environment.ts -> plugins/optimizeDeps.ts -> optimizer/index.ts -> optimizer/esbuildDepPlugin.ts -> plugins/css.ts -> build.ts -> config.ts -> server/environments/runnableEnvironment.ts -> server/environment.ts
Run & review this pull request in StackBlitz Codeflow. |
export function getDefaultResolvedEnvironmentOptions( | ||
config: ResolvedConfig, | ||
): ResolvedEnvironmentOptions { | ||
return { | ||
define: config.define, | ||
resolve: config.resolve, | ||
consumer: 'server', | ||
webCompatible: false, | ||
dev: config.dev, | ||
build: config.build, | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to move this one level up to /node/baseEnvironment
so we don't need to include /server/
from build.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, done 👍
Description
Some circular dependency in the code base was making the tests fail locally. This PR removes the circular dependencies to fix it.
related: https://discord.com/channels/804011606160703521/804439875226173480/1290196030847057961
Please check each commit message to see what circular dependency is removed.