Skip to content

Conversation

@nihalgonsalves
Copy link
Member

Description

Fixes #3312

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.

- v18 added the `ignoreDynamicRequires` option as a breaking change. The earlier behaviour matched `true`, so I set it as the default (ref: rollup/plugins#819)
- v19 is a breaking change since it now requires Rollup 2.38.0, but we’re already on 2.38.5. (ref: rollup/plugins#658)
@nihalgonsalves nihalgonsalves added bug bug: upstream Bug in a dependency of Vite dependencies Pull requests that update a dependency file p3-minor-bug An edge case that only affects very specific usage (priority) labels May 11, 2021
@patak-dev patak-dev changed the title fix: bump @rollup/plugin-commonjs to v19 fix: bump @rollup/plugin-commonjs to v19, fix #3312 May 11, 2021
@patak-dev patak-dev merged commit c6ef6d0 into vitejs:main May 11, 2021
@nihalgonsalves nihalgonsalves deleted the ng/rollup-commonjs-3312 branch May 11, 2021 19:33
fi3ework pushed a commit to fi3ework/vite that referenced this pull request May 22, 2021
- v18 added the `ignoreDynamicRequires` option as a breaking change. The earlier behaviour matched `true`, so I set it as the default (ref: rollup/plugins#819)
- v19 is a breaking change since it now requires Rollup 2.38.0, but we’re already on 2.38.5. (ref: rollup/plugins#658)
@haoqunjiang
Copy link
Member

  1. The commonjs.d.ts file is left out in this PR, should be updated too;
  2. I think the previous behavior is not exactly ignoreDynamicRequires: true.
    It's more like:
{
  dynamicRequireTargets: [],
  ignoreDynamicRequires: false
}

and

{
  dynamicRequireTargets: [/* any real targets */],
  ignoreDynamicRequires: true
}

But as the CommonJS plugin is mainly used for third-party dependencies in Vite apps, I think the latter use case is very rare, and it seems not quite useful either.
So maybe we should just use the default configuration.

@haoqunjiang
Copy link
Member

Fixing the ignoreDynamicRequires option will also fix #3426

Though, that issue seems also to be a Rollup bug. So it's not a very urgent issue here.
I'll file an issue to Rollup later.

@zshannon
Copy link

This new default broke my build. On v2.3.5 missing ignoreDynamicRequires: false means threejs-meshline can't locate three.js :(

It'd be nice to get types for the override option, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug: upstream Bug in a dependency of Vite dependencies Pull requests that update a dependency file p3-minor-bug An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Circular dependencies breaks vite build

5 participants