vercel / vercel/ncc

dist contains whole typescript lib

Open
#642 12 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
9.8k
Forks
326
PR merge metrics
No merged PRs in 30d

Description

When I use ncc build, the output contains all typescript/lib, such as below:
image

I try to comment a require statement like require(someConfigPath),it then no longer output typescript/lib. It seems like import a module using "require" has some problems.

Is there any workaround to use "require" and the dist dir not contains the whole typescript/lib ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with ncc build and a dynamic require(someConfigPath), then inspect why the generated dist output includes all of typescript/lib. Done means preserving the require behavior without bundling the whole TypeScript library; the issue names no source files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.