Tree shaking, removal of unused/dead code
cayolblake opened this issue · 1 comments
@nickreese for the life of me I'm not able to find a way to use Terser/Uglify to do treeshaking, or remove any JavaScript code that is not used, sometimes called dead code, for builds.
In terser (which supports ES6) for example, compress: {defaults: false, dead_code: true, unused: true} which ends up removing both unused and dead code, in addition to https://rollupjs.org/guide/en/#tree-shaking
Where/How to do it? 🤷
Elderjs does include terser in its default config:
elderjs/src/rollup/getRollupConfig.ts
Line 3 in 162972c
It is only used on production builds:
elderjs/src/rollup/getRollupConfig.ts
Line 15 in 162972c
elderjs/src/rollup/getRollupConfig.ts
Lines 65 to 77 in 162972c