Skip to content

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.

@github-actions
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
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nodes: Nodes system throws exceptions when used with vite, functionNode.call is not a function

3 participants