Replies: 1 comment 5 replies
-
esbuild can bundle all your dependencies into one file and minify it; that will probably help. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
May be you already replied this, but did not found such thread via search.
Context type: Server node application (not a cli tool, not an electron app).
My server app takes like whole minute to just start up, and about 50% of this time is loading of all these packages the server uses.
I seen some obscure hacks based on making pre-ready cache of filenames to speed up the way how require works, but I think should be some other less "hacky" solution to this?
May be some stricter rules flag that will allow to check less of possible paths? like
--speedy-load
...Or some way to "prepack" the application with packages to some fewer file(s), or some transpiler that will merge files across project where possible and will speed up the startup by reducing time need to scan actually huge tree of packages?
Or may be some binary format for packages can be added to node/npm where npm package becomes single file with pre-ast-ized binary contents of original js files and BSON for original JSON files, with strict declarations of exposed stuff in metadata, and loading of such submodules of such package done by resolving strict set of pre-known references within such package metadata instead of scanning a lot of possible paths, like
module-name.js
,module-name.json
, thanmodule-name/index.js
, and all other paths node checks on file loading?Such packed packages can have
mpm
file extensions?Beta Was this translation helpful? Give feedback.
All reactions