Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for TypeScript 3 Declaration map #820

Closed
JonWallsten opened this issue Aug 14, 2018 · 3 comments
Closed

Support for TypeScript 3 Declaration map #820

JonWallsten opened this issue Aug 14, 2018 · 3 comments

Comments

@JonWallsten
Copy link
Contributor

I'm going to be honest, I don't fully comprehend how ts-loader interacts with the typescript compiler (API?) so I'm not sure when/where in the chain this has to be corrected. But when enabling declarationMap: true in tsconfig and building with Webpack/ts-loader I don't get any map files.
When running the typescript compiler, tsc, I get those files.
I'm not sure if ts-loader isn't submitting the files or if I have to collect them somehow in my Webpack config. Maybe someone can enlighten me?

Expected Behaviour

When setting declarationMap: true in tsconfig I expect the d.ts.map file to be in my dist folder

Actual Behaviour

Only the d.ts files are ends up in the dist folder

Steps to Reproduce the Problem

Use latest webpack and ts-loader and enable declaration and declarationMap

Location of a Minimal Repository that Demonstrates the Issue.

Should be reproduces with any Webpack 4/Typescript@3.0.x starter repo.

@johnnyreilly
Copy link
Member

Do you have sourcemap: true in your tsconfig.json

@JonWallsten
Copy link
Contributor Author

JonWallsten commented Aug 15, 2018

@johnnyreilly Yeah! I get the maps when I run "tsc", I just don't get them when I run webpack/ts-loader.
The loader for instance adds my declaration files to the dist folder, but not the maps for them. But since this is a new feature since a couple of weeks I guess that's fair.

Edit: I guess this function would be responsible for it:
function provideDeclarationFilesToWebpack

I can try to get it to work and make a PR.

@JonWallsten
Copy link
Contributor Author

Fixed by #821

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants