-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
feat: support resolve.alias
per environment in Environment API
#17583
base: v6/environment-api
Are you sure you want to change the base?
Conversation
|
There are errors because the formatter wasn't run. It should be automatic when you commit. But you can run it manually if not. We have a lot of playgrounds already, so we should try to avoid new ones as much as possible. Maybe you could try adding the test to the environment-react-ssr playground? Maybe later on we can have a more generic one for these tests. |
@@ -40,7 +40,7 @@ export function createIdResolver( | |||
pluginContainer = await createEnvironmentPluginContainer( | |||
environment as Environment, | |||
[ | |||
aliasPlugin({ entries: config.resolve.alias }), // TODO: resolve.alias per environment? | |||
aliasPlugin({ entries: config.resolve.alias }), |
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.
This should be environment.options.resolve.alias
, the config has the default values. We were thinking that we should deprecate these defaults on the ResolvedConfig
and remove them later to avoid these issues.
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 kept this as a fallback and collecting the environment specific resolve.alias
in the plugin, but if it's not needed, I can change this to pass it directly. Makes total sense as this part is creating a plugin container for the environment.
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.
Ah, I see the new alias plugin. I think we don't need it. We can use the option here and keep everything else as is.
I only see that the deadlock test is failing, which was failing before my changes too and also locally, but I will re-check the formatter.
I will give it a go, probably I can integrate these tests into that playground. |
Re-run |
Ah, sorry for the noise. Format is ok, nvm that. |
Description
This PR implements the suggested solution in #17582 and adds a test playground named
environment-alias
to check that the new alias plugin is using theresolve.alias
specified per environment.