microsoft / microsoft/TypeScript

TypeScript refuses to emit files from node_modules with getEmitOutput()

Open
#11,946 8 comments 13 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Domain: JS Emit Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Hi. In out company we use workflow when all packages are written in pure TypeScript and we publish and consume them as-is, without any pre-compilation. I know that it's slower, but it's very convenient for developers, because they don't need to run several parallel tsc --watch processes.

We used webpack and awesome-typescript-loader for this and everything worked fine. But I see that now TypeScript refuses to emit files from node_modules directory using getEmitOutput(), because of isSourceFileFromExternalLibrary check here.

Can we make this configurable?

Contributor guide

Open the contributing guide

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 with getEmitOutput() and the isSourceFileFromExternalLibrary check in src/compiler/utilities.ts, as identified in the issue. Compare the current behavior with the reported webpack and awesome-typescript-loader workflow. Done means determining and implementing a configurable way to emit files from node_modules, with tests covering the requested behavior.

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
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.