-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
chore: add rollup plugins section #49
Conversation
I think we could add 5 or 6 more from the rollup official plugins A possible option is to add the section and if it gets too large, separate it to a different list linked from this one. Or directly start from a separate list. |
Listing all the compatible ones from the official Rollup plugins repo would be good enough, I think. It would so be helpful to me if someone goes through that list to see if there are plugins that should work but don't. |
I am going through the official plugins list. I'll report if I find a bug. |
That's great, I like the "Official already included in Vite" part! Thanks |
- [@rollup/plugin-commonjs](https://github.com/rollup/plugins/blob/master/packages/commonjs) - Convert CommonJS modules to ES6 | ||
- [@rollup/plugin-dynamic-import-vars](https://github.com/rollup/plugins/blob/master/packages/dynamic-import-vars) - Resolving dynamic imports that contain variables. | ||
- [@rollup/plugin-json](https://github.com/rollup/plugins/blob/master/packages/json) - Convert .json files to ES6 modules | ||
- [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/blob/master/packages/node-resolve) - Locate and bundle third-party dependencies in node_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vite actually uses a custom resolver because plugin-node-resolve
is too slow.
- [@rollup/plugin-dynamic-import-vars](https://github.com/rollup/plugins/blob/master/packages/dynamic-import-vars) - Resolving dynamic imports that contain variables. | ||
- [@rollup/plugin-json](https://github.com/rollup/plugins/blob/master/packages/json) - Convert .json files to ES6 modules | ||
- [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/blob/master/packages/node-resolve) - Locate and bundle third-party dependencies in node_modules | ||
- [@rollup/plugin-typescript](https://github.com/rollup/plugins/blob/master/packages/typescript) - Integration between Rollup and Typescript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default TypeScript is handled with a custom esbuild plugin and the typescript plugin is only used for bundling Vite itself.
In some cases users may want to disable the esbuild transform and use proper tsc instead (e.g. if they want decorators or latest ts features etc.) - I'm not sure if @rollup/plugin-typescript
would just work yet, will need to find out (it likely doesn't)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification, I will remove these two entries for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Evan, I included the ones that were in Vite's package.json, I should have dug deeper.
I was thinking about @rollup/plugin-image, from the docs looks like Vite supports importing images but it is not doing so by using this plugin. Should we include a section like: "Official plugins, with equivalent features in Vite" to list plugin-image, plugin-typescript, and plugin-node-resolve (and other similar cases)?
At least for me, it would be helpful to know that the features of these plugins are already covered (we can also link to the Vite docs for them)
General
Type
Checklist