Commonjs build breaks rollup (vitejs)
See original GitHub issueHello, any chance we could export styled-react-modal
as an esm module instead of commonjs (or both), this is causing issues when compiling with rollup (vitejs).
- My reproduction repo using vitejs + styled-react-modal https://github.com/vitejs/vite/issues/4935
- The thread about esbuilt and commonjs packages https://github.com/vitejs/vite/issues/4209#issuecomment-920938852
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Build Options - Vite
Options to pass on to @rollup/plugin-commonjs. build.dynamicImportVarsOptions #. Type: RollupDynamicImportVarsOptions; Related: Dynamic Import. Options to pass ...
Read more >How can I include dagre/graphlib in a vue.js site built with vite
This seems to be to do with the import mechanism of the commonjs libraries. I install npm install @rollup/plugin-commonjs --save-dev and moved ...
Read more >Vite 3.0 vs. Create React App: Comparison and migration guide
CommonJS ; Asynchronous Module Definition (AMD) API. webpack uses any of these JavaScript module systems to combine assets and modules into one ...
Read more >Adding Vite to Your Existing Web App | CSS-Tricks
Tell Vite where to put the generated bundle, what to call it, and what formats to build. Note that I'm using CommonJS here...
Read more >vite exports is not defined | The AI Search Engine You Control
vitejs /viteBundling SSR Modules using CommonJS exports alias results in ... rollupOptions: {} vite:config } vite:config } +9ms vite v2.8.5 building for ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry for taking a while to get back to you. I hope to have some time to look into this over the next couple weekends or so—busy times at my day job at the moment. I’d be happy to review a PR in the meantime if anyone has the time, but otherwise I’m hoping to address all the open issues before the new year.
The fix has been released: https://github.com/AlexanderRichey/styled-react-modal/releases/tag/v3.0.0