kodeaben
kodeaben

Reputation: 2055

typescript in gulp-concat file

I have an Angular 2 application in which i wish to use gulp to concat som libary files.

My task for just that look as follows: enter image description here

This produces a JS file and i reference it in my index.html: enter image description here

Now when i run this i get the following: enter image description here

and as we all know, there a no such thing as interfaces in js i must be dealing with typescript.

Can someone please tell me how to convert the typescript files in my libraries to js?

Upvotes: 2

Views: 266

Answers (2)

toskv
toskv

Reputation: 31600

The rxjs/** and @angular/** lines in the gulp.src task will result in all the files in those folders being concatenated. That means the .ts and .d.ts files in those folders as well.

You should change those lines to include only the javascript files.

For example:

rxjs/**/*.js
@angular/**/*.js

That should result in only javascript files being included.

Upvotes: 1

Jon Egerton
Jon Egerton

Reputation: 41539

Sounds like you're concatenating your ts source files into all.js, instead of the compiled js output from that ts.

It's not clear from the given example what you are using to do this, but you may need to add gulp-typescript to your gulp pipeline.

Upvotes: 0

Related Questions