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

Nodes: Mark directory as effectful for Webpack/Vite. #27376

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

CodyJasonBennett
Copy link
Contributor

Fixes: #27360

Description

#27189 marked only the entrypoint for three/nodes as effectful which sufficed for Webpack, but wasn't correct as per the below comment.

vitejs/vite#15319 (comment)
Yeah. According to my understanding, all modules in ./examples/jsm/nodes have side effects, so the value of the sideEffects field in https://github.com/mrdoob/three.js/blob/dev/package.json should be ./examples/jsm/nodes/**/* instead of ./examples/jsm/nodes/Nodes.js.

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
668.6 kB (166 kB) 668.6 kB (166 kB) +0 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
449.5 kB (108.9 kB) 449.5 kB (108.9 kB) +0 B
@Mugen87 Mugen87 added this to the r160 milestone Dec 14, 2023
@Mugen87 Mugen87 merged commit 64467c0 into mrdoob:dev Dec 14, 2023
12 checks passed
@CodyJasonBennett CodyJasonBennett deleted the nodes-treeshake-vite branch December 14, 2023 13:33
@hybridherbst
Copy link
Contributor

I'm afraid the issue still happens even with this change in place.

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