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
Can't seem to get Vite to accept top level await in a npm package #13
Comments
It's |
hm.. So you exclude it from the optimizations? I guess that is one way of doing it. |
Yes, what Vite's However, the esbuild arguments for optimizeDeps and production build (in production build there's also a esbuild step) are separated. This plugin overwrites the production esbuild's argument to stop esbuild from complaining the target doesn't support TLA (and finally, after processing TLAs, this plugin transform the code back to the orignal target with esbuild again). I will consider also overwrite the esbuild argument for optimizeDeps, I guess that will solve this issue. But notice that if you'are using |
Well it doesn't seem to matter if I use the |
Unfortunately I believe that is not related to my plugin -- since I don't do anything with the preview build. |
The original issue (error messages caused by |
Yes the first part of the problem was to exclude the library ( |
I am trying to build a small project, with
TypeScript
andSolidJS
, where I use a npm package (kissfft-wasm
) that uses a top level await in one of their files. But it just keeps failing with this message:I am not sure if the package is doing something wrong or my config is just not setup up correctly to use top level awaits.
Hopefully some of you bright people might know how to fix this.
My current vite.config.ts
I have tried a couple of things so this is the setup I was hoping would make it work, but doesn't.
I did try to add
optimizeDeps.include
but that didn't do much eitherThe text was updated successfully, but these errors were encountered: