How to improve DX and build time? #432
Replies: 3 comments 4 replies
-
Usually, build times increase with the number of entrypoints, so it's surprising to see a 30s dev startup for just 4 entrypoints... For reference, one of my extensions has ~9 entrypoints, and it takes 15s to start the browser in dev mode, and I would consider it a large extension as well. So I feel like something about your setup is wrong. Do you use lots of barrel files (re-exporting an entire folder from an index file)? That could maybe cause vite to have to load more source files than necessary, slowing things down. That's the only thing I can think of... #357 will help with this, but it's opt-in because it will effectively cause content scripts to ignore their |
Beta Was this translation helpful? Give feedback.
-
See I store a variable outside the plugin in the global context, and increment it on each build. Similar to your date approach. I suppose I could add the entrypoints being built in the
Yes, but content scripts are bundled using A caching plugin like this might be more effective: vitejs/vite#12943 I'm traveling right now, so I can't write much code for the next few days. If you're able to find something that's effective, I can add it to WXT. I have a similar extension that's all content scripts and is slow to build, so I'll try out a caching plugin sometime soon and see how it effects build times. |
Beta Was this translation helpful? Give feedback.
-
Just tried again. With vite 5.1.0 & 5.1.1 Now instead of erroring like yesterday. The Vite 5.0.12WXT 0.16.4 12:07:07 Vite 5.1.1WXT 0.16.4 12:09:56 I stopped the process at around 1 min and was still at the same step. |
Beta Was this translation helpful? Give feedback.
-
Hello!
What kind of build times do you get with your extensions?
And what did you try to speed up the build?
Fairly "complex" extension
PROD mode
DEV mode first start 32s (~16s on reload)
Extension is in a nx monorepo. Imports are all via tsconfig alias. So no code prebuilt.
Wondering if I could save a lot by prebuilding local deps used by the extension. But wondering if treeshaking would still work.
Beta Was this translation helpful? Give feedback.
All reactions