ncc: compile Node.js application into a single file
·
145 words
·
1 minute read
ncc is a command line application to compile a Node.js application into a single file. Supports TypeScript, binary addons and dynamic requires.
Bundle a Node.js application:
ncc build path/to/file.js
Bundle and minify a Node.js application:
ncc build --minify path/to/file.js
Bundle and minify a Node.js application and generate source maps:
ncc build --source-map path/to/file.js
Automatically recompile on changes to source files:
ncc build --watch path/to/file.js
Bundle a Node.js application into a temporary directory and run it for testing:
ncc run path/to/file.js
Clean the ncc cache:
ncc clean cache
More information: https://github.com/vercel/ncc .
I hope you enjoyed reading this post as much as I enjoyed writing it. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube , Twitter (x) , LinkedIn , and GitHub .