https://github.com/richplastow/tryout-tree-shaking-threejs
Work on THREE in 2022 made it more tree-shakable... let's try that out.
https://github.com/richplastow/tryout-tree-shaking-threejs
Last synced: 3 months ago
JSON representation
Work on THREE in 2022 made it more tree-shakable... let's try that out.
- Host: GitHub
- URL: https://github.com/richplastow/tryout-tree-shaking-threejs
- Owner: richplastow
- License: mit
- Created: 2023-01-09T11:47:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-09T23:49:06.000Z (over 2 years ago)
- Last Synced: 2025-01-06T01:10:44.677Z (5 months ago)
- Language: HTML
- Size: 1.19 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tryout Tree Shaking THREE.js 🌳
__Work on THREE in 2022 made it more tree-shakable... let's try that out.__
## Setup
Assuming you have `static-server` installed globally:
```sh
git clone [email protected]:richplastow/tryout-tree-shaking-threejs.git
cd tryout-tree-shaking-threejs
npm i
npm run build
static-server
```Then open http://localhost:9080/src/module/index.html in a browser.
If that’s working, `npm run publish` to populate docs/ ready for GitHub Pages.
## Builds:
-
src/module/index.html
src/module/script.js 900 bytes
....../build/three.module.js 1,172,800 bytes
-
src/legacy/index.html (can use file:///)
src/legacy/script.js 741 bytes
....../build/three.js 1,170,793 bytes
....../build/three.min.js 608,313 bytes
-
build/es/index.html
build/es/index.js 735,980 bytes
-
build/es-3min/index.html
build/es-3min/index.js 717,076 bytes
-
build/es-min/index.html
build/es-min/index.js 405,236 bytes (339,738 mangled (broken), 331,153 and compress.drop_console, 330,967 and compress.unsafe)
-
build/es-min-3min/index.html
build/es-min-3min/index.js 386,354 bytes (312,176 mangled (broken) and compress.drop_console/unsafe)
-
build/iife/index.html (can use file:///)
build/iife/index.js 753,044 bytes
-
build/iife-3min/index.html (can use file:///)
build/iife-3min/index.js 734,121 bytes
-
build/iife-min/index.html (can use file:///)
build/iife-min/index.js 405,272 bytes (331,003 mangled (broken) and compress.drop_console/unsafe)
-
build/iife-min-3min/index.html (can use file:///)
build/iife-min-3min/index.js 386,385 bytes (386,385 mangled (broken) and compress.drop_console/unsafe)
Dependencies:
- Rollup 3.9.1
- rollup-plugin-copy 3.4.0
- @rollup/plugin-terser 0.3.0
- @yushijinhun/three-minifier-rollup 0.4.0
- THREE 0.148.0