Skip to content

fix(alias): properly initialize custom resolvers#426

Merged
shellscape merged 2 commits intomasterfrom
fix-broken-alias
Jun 1, 2020
Merged

fix(alias): properly initialize custom resolvers#426
shellscape merged 2 commits intomasterfrom
fix-broken-alias

Conversation

@lukastaegert
Copy link
Copy Markdown
Member

Rollup Plugin Name: alias

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

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:
Resolves #203

Description

This will make sure that for all custom resolvers

  • the buildStart hooks are run if present during buildStart
  • the resolveId hook is run with correct this context

typeof customResolver.buildStart === 'function' &&
customResolver.buildStart.call(this, inputOptions)
)
).then(() => {});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldn't something be caught here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What do you expect to catch? If something fails, then Rollup's buildStart will pick it up. The empty then is just to satisfy the expected empty return type of buildStart.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We could also do a type cast here of course, but I do not think this is performance critical.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

just to satisfy the expected empty return type

Ah! Sorry

@shellscape shellscape merged commit eb73b0d into master Jun 1, 2020
@shellscape shellscape deleted the fix-broken-alias branch June 1, 2020 14:09
LarsDenBakker pushed a commit to LarsDenBakker/plugins that referenced this pull request Sep 12, 2020
* fix(alias): properly initialize custom resolvers

* chore(commonjs): add helpful comment
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.

Plugin Alias v3 throws error

3 participants