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(alias): properly initialize custom resolvers #426

Merged
merged 2 commits into from
Jun 1, 2020

Conversation

lukastaegert
Copy link
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

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

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