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

feat(alias)!: resolve entry id #1402

Merged
merged 1 commit into from
Apr 4, 2023
Merged

feat(alias)!: resolve entry id #1402

merged 1 commit into from
Apr 4, 2023

Conversation

bluwy
Copy link
Contributor

@bluwy bluwy commented Jan 13, 2023

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

List any relevant issue numbers:
fix #1190

Description

When the Rollup input is passed an aliased path, the alias plugin doesn't resolve it because it skips if there's no importer. I tracked this behaviour, and found it was not done in the past due to rollup/rollup-plugin-alias#29, but since the internals changed now, that PR's issue isn't relevant and we can continue to alias entry paths now.

@bluwy bluwy changed the title feat!(alias): resolve entry id feat(alias)!: resolve entry id Jan 13, 2023
BREAKING CHANGE: Aliased path without an importer (e.g. Rollup input) will also be resolved
@bluwy
Copy link
Contributor Author

bluwy commented Jan 15, 2023

My bad. Didn't notice my syntax in the other PR would also close this. Re-opened and it should still be good to go.

@shellscape
Copy link
Collaborator

but since the internals changed now

could you link to the internals you mentioned?

@bluwy
Copy link
Contributor Author

bluwy commented Jan 16, 2023

The old plugin code used to rely on the importer at https://github.com/rollup/rollup-plugin-alias/blob/0204677c0e1112cba7a5a0f60204ff1df81493b0/src/index.js#L80. Now we're not doing that anymore (we don't use the path nodejs module either). We're only passing the importer to the customResolver, which is currently correctly typed that importer could be defined.

Copy link
Collaborator

@shellscape shellscape left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks. I'd like to get another approval from another maintainer before we merge.

@shellscape shellscape merged commit a0242b2 into rollup:master Apr 4, 2023
@bluwy bluwy deleted the alias-resolve-entry branch April 4, 2023 13:48
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.

Cannot use an alias as an input
2 participants