Skip to content
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

Vite takes a long time to build first time #1935

Open
torchesburn opened this issue Dec 5, 2021 · 3 comments
Open

Vite takes a long time to build first time #1935

torchesburn opened this issue Dec 5, 2021 · 3 comments

Comments

@torchesburn
Copy link
Contributor

torchesburn commented Dec 5, 2021

image
Hangs on this for a long time and does not reload page.

@avaer
Copy link
Contributor

avaer commented Dec 5, 2021

Yes it's quite a nightmare :(. Esbuild is supposed to be fast. The problem is that initially it must discover all of the imports and build them. Once it's cached it is relatively fast.

I suspect almost all of this is the massive, complicated libs we include, like THREE.js, and the complex dynamic import dependency chain that causes it to have to restart the build once it finds new includes.

Note that the latter is somewhat fundamental to the dynamic import loading nature of webaverse/totum, so I'm not sure if/how we could optimize dynamic imports easily. However, I am convinced with a day or two of thought this could be made blazing fast, possibly with some hacks. I think it's important we get this dev experience right.

I believe vite.js has ignore path options we can use. Failing that, we have full control of the server and we can short-circuit any import that causes these issues.

@avaer
Copy link
Contributor

avaer commented Dec 5, 2021

We could also temporarily disable things like ceramic which are not hooked in yet.

@torchesburn
Copy link
Contributor Author

Some very good points about THREE, especially when doing * as THREE, but agree about dynamic imports and the nature of the architecture.

I know we can also try tree-shaking with named imports, that could possibly speed up the initial build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants