Conversation
|
This PR does not work in vite browsers builds. I will look into a solution to support browsers as well. |
f802e37 to
12d09d5
Compare
fixes mholt#977
|
With the latest force push, I added the esm directory, which supports esm + browser & esm + module exports, using esm/package.json. ESM & vite browser builds are now supported. {
"main": "./index.mjs",
"browser": "./index.browser.mjs"
}"browser" takes precedence over "main" & "module" takes precedence over "browser", which is why I'm using "main" & "browser". I have tested this in my astro.js/vite browser & server side builds. |
|
There's a problem with the latest force pushed commit. The vite server side build seems to use the "browser" import, which causes an error: Looking into another fix for this... |
…await plugin package is used See vitejs/vite#12253 See mholt#978
|
If vite fixes the issue vitejs/vite#12253, then this PR should work. In the meantime, I added https://github.com/btakita/PapaParse/tree/vite-plugin-top-level-await, which will work in server side vite builds using the vite-plugin-top-level-await plugin package. |
|
Would this allow us to use esm modules in angular-cli as well? Or would more work need to be done for that? Trying to avoid the "optimization bailouts" warning. |
jschang19
left a comment
There was a problem hiding this comment.
This modification works for my Nuxt3 project deploying on Cloudflare worker, where I couldn't deploy LLaMAindex since the current version doesn't come with an ESM support. Thx for your contribution!
|
So? Can we after years get ESM build? |
|
Is there more discussion to be had on this? It seems like a slam dunk and would greatly help a lot of developers. Can we please get this merged in? |

fixes #977