Skip to content

fix(config): don't resolve by module field#10347

Merged
patak-dev merged 1 commit intovitejs:mainfrom
sapphi-red:fix/use-config-with-modue-field
Oct 5, 2022
Merged

fix(config): don't resolve by module field#10347
patak-dev merged 1 commit intovitejs:mainfrom
sapphi-red:fix/use-config-with-modue-field

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
@gb-jos
Copy link
Contributor

gb-jos commented Oct 5, 2022

@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.

3 participants

Comments