You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for the investigation. Since we actually don't feature any side effects, I've filed #1643. It will be released as part of 3.2 (hopefully next week).
Reproduction: https://github.com/jindong-zhannng/langium-bundle-test
Bundler: vite
There is only one import in
main.ts
(to simulate the case ofgenerated/ast.ts
):And class
AbstractAstReflection
also has zero dependency.Expect: Bundle should only include
AbstractAstReflection
relevant code.Actual:
(run
npx vite-bundle-visualizer --open -o ./stats.html
to generate report)Obviously it includes lots of dead code like parser, validator and their dependencies. It brings the bundle size up to 174.67 kB (minified).
Idea
I tried to add
"sideEffects": false
topackage.json
. It significantly reduces the size to 1.27 kB and has a perfect report:I'm not sure if it's suitable for langium and I also don't have a very good understanding of this setting. Just put it here for your reference.
The text was updated successfully, but these errors were encountered: