awesome-typescript-loader icon indicating copy to clipboard operation
awesome-typescript-loader copied to clipboard

Files with only type declarations do not get declaration files generated

Open jamiebuilds opened this issue 8 years ago • 8 comments

Test repo: https://github.com/thejameskyle/test-awesome-ts-loader

If I have a file like this:

export interface a {}

And I run with these options:

{
  test: /\.tsx?$/,
  loader: 'awesome-typescript-loader',
  options: {
    declaration: true,
    declarationDir: './types',
  },
},

It will not create a file.

As soon as I add a value it will though.

  export interface a {}
+ export const b = {};

jamiebuilds avatar May 17 '17 05:05 jamiebuilds

I'm having a similar problem, but can't resolve it by adding an "export const WORKAROUND = 'workaround'". In addition, I need to import the const, and use it somewhere in a .ts file. I've put together a minimal project that shows this: https://github.com/tobiaspatton-s4/atl-interface-test

tobiaspatton-s4 avatar Sep 20 '17 18:09 tobiaspatton-s4

Having the same issue on 3.4.1

Using regular tsc works fine though.

dolanmiu avatar Jan 31 '18 19:01 dolanmiu

@s-panferov any pointers as to where to look in the code to fix this?

octatone avatar Feb 07 '18 16:02 octatone

Another test case: https://github.com/sqwk/declaration-test (Previously for a typescript bug—turns out tsc works fine …)

sqwk avatar May 30 '18 21:05 sqwk

I also have the same error, awesome-typescript-loader version 5.2.1 doesn't export my files containing only interface declarations :(

PierreCapo avatar Dec 26 '18 23:12 PierreCapo

Same issue here. Is there any update on this?

Mrtenz avatar Jan 12 '19 13:01 Mrtenz

The last proper code commit was in Jul 2018, so probably no update on this. Maybe this project is dead?

https://github.com/s-panferov/awesome-typescript-loader/commits/master

dolanmiu avatar Jan 12 '19 18:01 dolanmiu

For anyone wanting a quick fix until ATL gets updated, ts-loader ended up working fine for me.

DanDobrick avatar Jan 22 '19 18:01 DanDobrick