Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Is it possible to declare references to *.d.ts files only in tsconfig.json, not in *.ts files? #43

Closed
Den-dp opened this issue Aug 7, 2015 · 3 comments

Comments

@Den-dp
Copy link

Den-dp commented Aug 7, 2015

I found that awesome-typescript-loader fails on compiling *.ts files without special reference comments to external modules, but tsc command works well in this situation.

I assume that this is probably because I moved all references to tsconfig.json and for some reason awesome-typescript-loader doesn't use them.

If you need repro you can grab this repo https://github.com/Den-dp/webpacked-typescript-demo and run npm start to install all deps and run webpack.

Compilation with tsc works fine (even with commented reference https://github.com/Den-dp/webpacked-typescript-demo/blob/master/src/app.ts#L1 ), but compilation with webpack gives me the following error:

[webpacked-typescript-demo@1.0.0] C:\dev\webpacked-typescript-demo (master)
λ webpack
Hash: ed9338a38e248b532e37
Version: webpack 1.11.0
Time: 2214ms
        Asset    Size  Chunks             Chunk Names
    bundle.js  427 kB       0  [emitted]  main
bundle.js.map  506 kB       0  [emitted]  main
    + 4 hidden modules

ERROR in C:/dev/webpacked-typescript-demo/src/app.ts:4:20
Cannot find module 'lodash'.

Am I missing something?

@s-panferov
Copy link
Owner

@Den-dp thanks for you report. Right now the loader fetches only compiler options from tsconfig.js. This is because it's webpack job to find all the references and dependencies. But I think, that the loader possibly can fetch also all the .d.ts files without any harm. I'll implement this soon.

@Den-dp
Copy link
Author

Den-dp commented Aug 10, 2015

@s-panferov Thanks for the quick response! It would be great to add this kind of functionality and I hope it's possible.

Thanks for your time

@s-panferov
Copy link
Owner

@Den-dp sorry for the delay, landed in v0.12.0

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

No branches or pull requests

2 participants