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): don't resolve by module field #10347

Merged
merged 1 commit into from Oct 5, 2022

Conversation

sapphi-red
Copy link
Member

Description

rollup plugins declares module field.
https://github.com/rollup/plugins/blob/4e85ed78cd2e941107fdf0e8e118e7bee550109d/packages/yaml/package.json#L17

But this field could resolve to .js files and this cannot be externalized because it will be treated as CJS by node.

This PR changes mainFields to be [] so that module field won't be used when a module is externalized.

reproduction

related: #10254

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 the p4-important Violate documented behavior or significantly improves performance (priority) label Oct 5, 2022
@patak-dev patak-dev merged commit cc1c829 into vitejs:main Oct 5, 2022
@jiby-aurum
Copy link
Contributor

@patak-dev just noticed this with 3.2.0-beta.0, for me failing with @rollup/plugin-inject, would it be possible to have a 3.2.0-beta.1 release with this fix ?

@sapphi-red sapphi-red deleted the fix/use-config-with-modue-field branch October 6, 2022 10:27
patak-dev pushed a commit that referenced this pull request Oct 6, 2022
* fix(config): don't resolve by module field (#10347)

* chore: fix build error

Co-authored-by: 翠 / green <green@sapphi.red>
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants