Is there some sort of possible DCE like procedure for es6 projects ?
Is there a final build that packages it for release?
I used npm run build.
You lose the dead-code elimination feature that Haxe provides, but you do get some features that help make up the slack. First, when you import different modules (like import Point from "openfl/geom/Point"
rather than import * as openfl from "openfl"
) there is some code elimination because not all the library is imported. Second, there are some tools that can perform code elimination (or “tree shaking” seems to be the popular term) to reduce the size a bit.
Our template project has npm start -s
to run a dev server, and npm run build:dev
and npm run build:prod
, the default of npm run build
being the production configuration, which runs minification and some code elimination on it. I have more work to do to make sure our modules are loosely tied to each other, so using one feature doesn’t require any more of the OpenFL library than you would really need
(Remember as far as final size, though, that most servers are gzipped, so the download size is the zipped size of your minified JS)
Yeah, just tried to upload an npm run build to a server and it was pretty fast loading on the network browser graph.