TypeStrong / TypeStrong/ts-loader
ts-loader doesn't work when ts-config noEmit is set to true
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.5k
- Forks
- 439
- Avg merge
- 17h 17m
- Merged PRs (30d)
- 2
Description
TypeScript: v5.0.2
Webpack: v5.76.3
Expected Behaviour
When bundling a ESM module with noEmit, Webpack is able to generate a bundle using ts-loader
Actual Behaviour
Module build failed (from ./node_modules/ts-loader/index.js):
Error: TypeScript emitted no output for C:\Users\ms\Projects\ts-loader\index.ts.
at makeSourceMapAndFinish (C:\Users\ms\Projects\ts-loader\node_modules\ts-loader\dist\index.js:52:18)
at successLoader (C:\Users\ms\Projects\ts-loader\node_modules\ts-loader\dist\index.js:39:5)
at Object.loader (C:\Users\ms\Projects\ts-loader\node_modules\ts-loader\dist\index.js:22:5)
Steps to Reproduce the Problem
- Clone the demo repository
- npm-install
- npm-run-build it
Location of a Minimal Repository that Demonstrates the Issue.
https://github.com/minecrawler/ts-loader
Further info
connected to #161
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked minimal repository: install its dependencies and run the build using TypeScript 5.0.2 and webpack 5.76.3. Trace the failure through ts-loader/dist/index.js at makeSourceMapAndFinish and successLoader, using the index.ts entry point; done means the ESM bundle builds successfully when noEmit is true without the emitted-no-output error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100