Typescript+webpack: typescript emmited no output for index.d.ts

后端 未结 2 1910
长发绾君心
长发绾君心 2021-01-19 03:23

I followed this tutorial to setup typescript+webpack (no react) with success. It all works great until I add index.d.ts file my components folder, which I use to export all

2条回答
  •  梦毁少年i
    2021-01-19 03:55

    index.d.ts

    This is a declaration file. A declaration file has no javascript emit.

    Fix

    instead of adding .d.ts as a resolvable extension (don't do that!), add the .d.ts into the compilation context, using something like tsconfig.json

    More

    https://alm-tools.gitbooks.io/alm/content/config/tsconfig.html

提交回复
热议问题