Open cayolblake opened 1 year ago
Elderjs does include terser in its default config: https://github.com/Elderjs/elderjs/blob/162972ccdbad7f5569096bd5794cd59271c6004a/src/rollup/getRollupConfig.ts#L3 It is only used on production builds: https://github.com/Elderjs/elderjs/blob/162972ccdbad7f5569096bd5794cd59271c6004a/src/rollup/getRollupConfig.ts#L15 https://github.com/Elderjs/elderjs/blob/162972ccdbad7f5569096bd5794cd59271c6004a/src/rollup/getRollupConfig.ts#L65-L77
@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? 🤷