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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow resolveId to return an object #2734

Merged
merged 2 commits into from Mar 7, 2019
Merged

Allow resolveId to return an object #2734

merged 2 commits into from Mar 7, 2019

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

This change will extend the syntax of the resolveId hook to support returning an object

interface ResolvedId {
  // the absence of this property is interpreted the same as "false"
  external?: boolean;
  id: string;
}

The immediate advantage of this change is to allow plugins to resolve an import to a new id while marking it as external at the same time. Previously, this required the user to also add the new id as an external id manually.

The main reason for this addition, however, is that I want to have an extended format that allows you to pass more meta information with this hook in the future (say, package side-effects... 馃槣).

A minor side-effects of this change is that you will only be warned about missing global names for an external dependency in a UMD bundle if the dependency is actually used.

@lukastaegert lukastaegert merged commit 5bf2144 into master Mar 7, 2019
@lukastaegert lukastaegert deleted the resolve-id-object branch March 7, 2019 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants