chevrotain
chevrotain copied to clipboard
Smaller web bundle size
The chevrotain.min,js
and chevrotain.min.mjs
are currently 156/160kb respectively. (version 9.1.0).
This will likely slightly increase in v10 due to the introduction of lodash as a dependency.
Some avenues which may help decrease the bundle size:
- [ ] Find a way to avoid duplicate TypeScript helpers.
- e.g: search for:
var __extends = (this && this.__extends)
inchevrotain.js
(none minified). - [ ] Would ` target : "es2015" in the tsconfig reduce the bundle size, by reducing transpilation to lower level EcmaScript?
- [ ] Provide a specialized bundle which only includes the mandatory runtime components, e.g:
- No diagrams related sources
- No @chevrotain/cst-gen (not yet used by the main
chevrotain
package, but will be in the future). - Empty implementations for most (all?) of the grammar / lexer validations and checks.
https://stackoverflow.com/questions/20128257/typescript-removing-extends-duplicates
206K --> 136K (chevrotain.min.js) is good enough for now. Closing this issue.