ncc

Compile Node.js modules and dependencies into a single self-contained file.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill ncc-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ncc
Source: https://github.com/AarnavBaddam/skills/tree/main/ncc
Command: npx skills add https://github.com/AarnavBaddam/skills --skill ncc-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deploying Node.js applications typically requires shipping the entire node_modules directory, which bloats serverless functions, CLI tools, and Docker images. This Skill provides expert guidance for using @vercel/ncc to bundle a Node.js module and all its dependencies into one output file. ## Core Features & Use Cases - Single-File Bundling: Compile a Node.js entry point with all dependencies inlined into one distributable file using ncc build. - Native TypeScript Support: Compile .ts files directly using the project's tsconfig.json, with an option to skip type checking for faster builds. - Externals and Asset Handling: Keep native or runtime-provided modules (like aws-sdk) external while automatically copying non-JS assets to the output directory. - Use Case: You are publishing a GitHub Action written in TypeScript. Use ncc to bundle src/index.ts into a minified dist/index.js with a licenses file, so the action runs without installing dependencies. ## Quick Start Ask the AI to bundle your TypeScript entry file into a minified single-file output in the dist directory using ncc.

Frequently Asked Questions about ncc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I bundle a Node.js project into a single file?

Run ncc build with your entry file, for example: ncc build index.js -o dist/. This compiles the module and all its node_modules dependencies into one output file, with flags like -m for minification and -s for source maps.

Does ncc support TypeScript without a separate tsc step?

Yes, ncc compiles TypeScript files directly using the project's tsconfig.json, so no separate tsc step is needed. Use the -t or --transpile-only flag to skip type checking for faster builds.

How do I exclude modules from an ncc bundle?

Use the -e or --external flag to keep specific modules out of the bundle, such as ncc build input.js -e aws-sdk. This is useful for native modules or runtime-provided dependencies like aws-sdk in AWS Lambda.

Can ncc bundle GitHub Actions written in TypeScript?

Yes, ncc is the recommended bundler for custom JavaScript and TypeScript GitHub Actions. Run ncc build src/index.ts -o dist/ -m --license licenses.txt to produce a single file with all dependencies bundled, which Actions require.

What happens to non-JavaScript assets when bundling with ncc?

ncc automatically copies non-JS assets such as .json, .node, and binary files to the output directory alongside the compiled file. They are referenced correctly at runtime, and nested asset builds can be disabled with --no-asset-builds.