-
Notifications
You must be signed in to change notification settings - Fork 9
vite build
causes OOMs due to spawning deno info
with unbounded concurrency.
#50
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
Comments
I also noticed way slower builds: With plugin:
Without plugin:
|
I found a workaround for my case. My deno.json file contained the following and I wanted that to be honored by Vite. "imports": {
"src/": "./src/",
"lib/": "./lib/"
}, And I found that I can do that with resolve.alias: export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"lib": import.meta.resolve("./lib"),
"src": import.meta.resolve("./src"),
},
},
}); |
This fix builds on the insight in denoland#55 but does so by performing the minimal change required to fix the underlying issue. The reason for this departure from denoland#55 is due to our project's build failing when executed using the proof of concept's plugin, presumably due to some unknown change introduced on part of the proof of concept's extensive revision. The fix reuses @notcome's lock component and threads said lock through the codebase to ultimately place it around the `deno info --json ${id}` calls.
This fix builds on the insight in denoland#55 but does so by performing the minimal change required to fix the underlying issue. The reason for this departure from denoland#55 is due to our project's build failing when executed using the proof of concept's plugin, presumably due to some unknown change introduced on part of the proof of concept's extensive revision. The fix reuses @notcome's lock component and threads said lock through the codebase to ultimately place it around the `deno info --json ${id}` calls.
For what it's worth: We've forked this at https://github.com/masslbs/deno-vite-plugin and published the fork so that it can be used by ci: https://www.npmjs.com/package/@masslbs/deno-vite-plugin Info from the fork's README:
|
When using this plugin, we notice that builds OOM, because too many
deno info
processes are spawned. This causes >8GB of memory pressure on our build machine, which kills the build :(In addition, build times are significantly slower due to having to call out to
info
for every dependency. This slows down our build significantly, taking the total vite build time from ~2.43s to 20s on my machine.The text was updated successfully, but these errors were encountered: