About
A demo project for ycw/e2edce, showing how to eliminate deadcode for threejs appliaction.
-
it rewrites import source from
three
tothree/src/Three
, and -
it minifies glsl sources in shaderchunk/ and shaderlib/.
- open devtools network panel, check size|content-length of 'index.bulid.js' for each test; if you're using chrome browsers, check also its coverage
Logs Vector2
βββββββββββ¬βββββββββββ
β (index) β size β
βββββββββββΌβββββββββββ€
β flat β '6.10Kb' β
β dce β '1.91Kb' β
β min β '87b' β
β min+gz β '96b' β
βββββββββββ΄βββββββββββ
Rotating Cube
βββββββββββ¬βββββββββββββ
β (index) β size β
βββββββββββΌβββββββββββββ€
β flat β '693.53Kb' β
β dce β '412.68Kb' β
β min β '218.51Kb' β
β min+gz β '53.56Kb' β
βββββββββββ΄βββββββββββββ
Pick Rotating Cube
βββββββββββ¬βββββββββββββ
β (index) β size β
βββββββββββΌβββββββββββββ€
β flat β '696.50Kb' β
β dce β '427.08Kb' β
β min β '226.27Kb' β
β min+gz β '55.77Kb' β
βββββββββββ΄βββββββββββββ
webgl_shaders_ocean.html
βββββββββββ¬βββββββββββββ
β (index) β size β
βββββββββββΌβββββββββββββ€
β flat β '777.52Kb' β
β dce β '576.02Kb' β
β min β '307.84Kb' β
β min+gz β '79.44Kb' β
βββββββββββ΄βββββββββββββ
cannon-es/examples/threejs_mousepick
βββββββββββ¬βββββββββββββ
β (index) β size β
βββββββββββΌβββββββββββββ€
β flat β '948.81Kb' β
β dce β '627.66Kb' β
β min β '296.49Kb' β
β min+gz β '75.38Kb' β
βββββββββββ΄βββββββββββββ
Build Locally
- Clone this repo
- Install deps,
npm i
- Create builds,
npm run build
- Boot http server,
npm run serve
- Check testbed at
http://localhost:8080
To test your own codes:
- Put your codes in
src/foo.js
- Write tests in
tests/foo.js
- Config e2edce in
e2edce.config.js
- Create build,
npm run build
- Check result at
http://localhost:8080/public/foo/index.html