-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Add dev builds to speed up dev iteration #30865
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
base: dev
Are you sure you want to change the base?
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
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. |
This PR is a huge improvement. I’ve never relied on the current build outputs during development and always end up manually rewriting imports to point to src/. Having this streamlined setup will make iteration smoother for everyone. |
Agreed - I think this should be merged. There have been a lot of reasons provided for why this is a valuable improvement and not a lot provided for why it's harmful to the dev process. To me it's clear from using the current dev workflow and from how other maintainers are modifying files for development that the current build time is only a drag on the current dev process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm convinced. If multiple collaborators want this change because it improves their workflows, I don't want to be the one who blocks it 😅 .
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: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
ornpm run dev-ssl
In preview phase, users should run
npm run preview
ornpm run preview-ssl