vercel / vercel/ncc

Recursively resolve typescript types

Open
#386 3 comments 0 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

I expect the output of ncc to be runnable without npm dependencies.
However, if I have a type that is included from another library, I need to keep that library as a dependency and the types are not resolved.
So an import is not being resolved and the output of ncc looks like this:

import { Type } from 'library'

As this is already the behavior of the code bundling with Webpack, I would expect this to work with TypeScript, too.

In other words we need a Webpack for typings.

This could e.g. be done with https://www.npmjs.com/package/declaration-bundler-webpack-plugin

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

The issue names no ncc files or tests; start by tracing how ncc handles TypeScript declarations and how its Webpack bundling behavior is implemented. Review declaration-bundler-webpack-plugin as a possible reference, then define a reproducible case where an imported type is recursively bundled and the generated output has no dependency on that library.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.