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(legacy): normalize exports paths #775

Merged
merged 3 commits into from Jan 29, 2021

Conversation

patak-dev
Copy link
Contributor

@patak-dev patak-dev commented Jan 25, 2021

Rollup Plugin Name: legacy

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

Description

Vite 2 implements a universal rollup plugin API (for the ESM based dev server, and the build using rollup). Plugins are mostly compatible. I am maintaining a compatibility list for official rollup plugins here.

One difference in the dev server is that Vite normalizes paths to use posix slashes (in the same way as normalizePath in @rollup/pluginutils) while resolving ids. This is not an issue generally because utils like createFilter also normalize ids while matching.

This PR uses rolluputils.normalizePath to normalizes ids in the exports map for @rollup/plugin-legacy so it is compatible with Vite. This will fix vitejs/vite#1521

@patak-dev patak-dev changed the title Feat/legacy normalize paths feat(legacy): normalize exports paths Jan 25, 2021
@shellscape
Copy link
Collaborator

thanks!

@shellscape shellscape merged commit 03e32d2 into rollup:master Jan 29, 2021
@patak-dev
Copy link
Contributor Author

Thanks a lot @shellscape! Only one issue away (waiting for PR in Vite's side) and every official rollup plugin will be compatible with Vite 🎉

@shellscape
Copy link
Collaborator

That's great news!

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.

@rollup/plugin-legacy issue in windows
2 participants