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

Add dev builds to speed up dev iteration #30865

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Add dev builds to speed up dev iteration #30865

wants to merge 2 commits into from

Conversation

ycw
Copy link
Contributor

@ycw ycw commented Apr 4, 2025

fix: #30829

Description

Idea #30851 (comment) is that creating stub build files to speed up dev iteration, and no bundling at all, e.g. content of build/three.module.js is now:

// dev mode
export * from '../src/Three.js';

This way build time is negligible, and /src can be reflected in devtools. Header comments is added to build files, so that the existent of /build is more reasonable upon debugging. Since dev phase and preview phase are now split, I added two npm scripts for verifying real build files.

In dev phase, users should run npm run dev or npm run dev-ssl

In preview phase, users should run npm run preview or npm run preview-ssl

Copy link

github-actions bot commented Apr 4, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.44
78.37
336.44
78.37
+0 B
+0 B
WebGPU 541.67
150.04
541.67
150.04
+0 B
+0 B
WebGPU Nodes 541.14
149.93
541.14
149.93
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 465.37
112.21
465.37
112.21
+0 B
+0 B
WebGPU 614.51
166.09
614.51
166.09
+0 B
+0 B
WebGPU Nodes 569.5
155.49
569.5
155.49
+0 B
+0 B

@gkjohnson
Copy link
Collaborator

cc @Mugen87 @mrdoob @donmccurdy what do you think of a solution like this? I'm not sure if we need a "preview" script but this kind of solution would fix the recent issues associated with dev build times.

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

Successfully merging this pull request may close these issues.

Three.js dev iteration process, bundling has become really slow
2 participants