Closed quantuminformation closed 7 years ago
Same here... Can't get this to work with awesome-typesctipt-loader
Yep. Trying to upgrade from 2.2.4 makes my .d.ts file almost empty... and 2.2.4 doesn't work with the latest typescript version: #293
pretty much having to run a separate gulp build just for the declarations; ts-loader isn't great either and cannot exlcude test files. :/
Hmm I was just about to add tests with ts-loader, are you sure about this @MeirionHughes ?
isn't there a spec in ts that tells tsc to ignore a file, like naming with _test in the filename?
@QuantumInformation
rules: [ { test: /\.ts?$/, exclude: [ path.resolve(__dirname, "test")], loader:"ts-loader"], ...
... had no effect.
Unfortunately, I cannot use exclude in the tsconfig because its used used by ts-node + mocha for testing.
In addition: rather than get ./lib/index.d.ts
I'm getting ./lib/src/index.d.ts
et al
I tried getting tsc to emit only the declarations, but that didn't work. In the end, it was simply easier to gulp it:
var gulp = require('gulp');
var gulpts = require('gulp-typescript');
var typescript = require('typescript');
gulp.task('typings', () => {
var project = gulpts.createProject('tsconfig.json', {
typescript: typescript
});
return gulp.src(['src/**/*.ts']).pipe(project()).dts.pipe(gulp.dest('./lib'));
});
I did this with ts-loader in the same repo and it works(produces /src)