antfu / vitesse-webext

⚡️ WebExtension Vite Starter Template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling content script with many modules is painfully slow

Merlin04 opened this issue · comments

Hello, I'm using vitesse-webext to develop a fairly large browser extension where the majority of the code is in the content script (using React and other libraries like MUI and Framer Motion). However, the build times for my content script have become painfully slow, taking between 10 and 25 seconds per rebuild:

build started...
✓ 11020 modules transformed.
../extension/dist/contentScripts/index.global.js   744.09 KiB / gzip: 230.18 KiB
../extension/dist/contentScripts/index.global.js.map 3180.64 KiB
built in 17941ms.

Most of the time spent building is after it has printed out the "modules transformed" message - it sits there without any output for a considerable amount of time, then prints rendering chunks (1)..., then a half a second later prints out the rest of the output.

Is there any way I can make this build faster?

I experience the same issue, once I migrated to monorepo, the build times increased dramatically.

I experience the same issue, once I migrated to monorepo, the build times increased dramatically.

Which monorepo did you use? Turborepo? I'd love to see how you configured it.