2021-03-15 15:32:48 -03:00
|
|
|
# ncc
|
|
|
|
|
|
|
|
> Compile a Node.js application into a single file.
|
|
|
|
> Supports TypeScript, binary addons and dynamic requires.
|
|
|
|
> More information: <https://github.com/vercel/ncc>.
|
|
|
|
|
|
|
|
- Bundle a Node.js application:
|
|
|
|
|
|
|
|
`ncc build {{path/to/file.js}}`
|
|
|
|
|
|
|
|
- Bundle and minify a Node.js application:
|
|
|
|
|
2025-04-27 10:59:15 +03:00
|
|
|
`ncc build {{[-m|--minify]}} {{path/to/file.js}}`
|
2021-03-15 15:32:48 -03:00
|
|
|
|
|
|
|
- Bundle and minify a Node.js application and generate source maps:
|
|
|
|
|
2025-04-27 10:59:15 +03:00
|
|
|
`ncc build {{[-s|--source-map]}} {{path/to/file.js}}`
|
2021-03-15 15:32:48 -03:00
|
|
|
|
|
|
|
- Automatically recompile on changes to source files:
|
|
|
|
|
2025-04-27 10:59:15 +03:00
|
|
|
`ncc build {{[-w|--watch]}} {{path/to/file.js}}`
|
2021-03-15 15:32:48 -03:00
|
|
|
|
|
|
|
- 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`
|