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

fix(config): resolve externalized specifier with internal resolver #10683

Merged
merged 2 commits into from
Oct 28, 2022

Conversation

sapphi-red
Copy link
Member

Description

This PR reverts #10528 and implementes the first suggestion of #10495.

import-meta-resolve didn't work with yarn (#10652) and this PR fixes that.
This PR also fixes #10649. (But I don't consider this as a regression. That import should be imported with extension tailwindcss/plugin.js)

fixes #10649
fixes #10652

refs #10254 #10495 #10528

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added p4-important Violate documented behavior or significantly improves performance (priority) regression The issue only appears after a new release labels Oct 28, 2022
@sapphi-red sapphi-red marked this pull request as ready for review October 28, 2022 07:22
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing these again 😅

Part of me wanted to skip resolving if the file we're bundling is under the same package.json, so we soften the blow with these changes, but hopefully this would do the trick.

@patak-dev patak-dev merged commit b15d21c into vitejs:main Oct 28, 2022
@sapphi-red sapphi-red deleted the fix/config-externalize-resolve branch October 28, 2022 08:13
@aleclarson
Copy link
Member

@sapphi-red Friendly suggestion: Some review comments on your changes would help me understand your PRs better when I'm rebasing my fork in the future 😇

* @deprecated In future, `conditions` will work like this.
* @internal
*/
overrideConditions?: string[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? Hard to know from just reading the code.

Copy link
Member

@aleclarson aleclarson Nov 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I think I get it.

This option decides which of the default conditions (production, development, module) are allowed. It may also add custom conditions, and it prevents the conditions option from being used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct.

if (options.overrideConditions) {
conditions.push(
...options.overrideConditions.filter((condition) =>
conditionalConditions.has(condition)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a typo.

The has check should be negated, yes?

Copy link
Member Author

@sapphi-red sapphi-red Nov 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks. I'll fix it with some refactor around this.

@sapphi-red sapphi-red mentioned this pull request Nov 14, 2022
9 tasks
aleclarson added a commit to aleclarson/vite that referenced this pull request Nov 14, 2022
Bug introduced in vitejs#10683

Some packages use "require" instead of "default" for CJS entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Violate documented behavior or significantly improves performance (priority) regression The issue only appears after a new release
Projects
None yet
4 participants