Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulp-typescript & gulp.src issue #186

Closed
SIGAN opened this issue Feb 13, 2016 · 7 comments
Closed

gulp-typescript & gulp.src issue #186

SIGAN opened this issue Feb 13, 2016 · 7 comments

Comments

@SIGAN
Copy link

SIGAN commented Feb 13, 2016

Dear Valor team,

Could you please fix the following issue:
If you use gulp-typescript specifying source files using gulp.src and you specify to outFile to build a bundle, typescript will include ng2-bootstrap into that bundle. If you include ng2-bootstrap.min.js bundle on that page it won't work, if you don't - it won't work neither.

The root cause:
Source *.ts files present in the same folder as *.js files in npm module.
And TypeScript just compiles it. Exclude option of tsconfig.json won't work, as it is ignoring it.

How to fix:
It's very simple please make dedicated folder src and include *.ts files there. Other folders should contain only *.js, *.js.map, *.d.ts and no original *.ts files.

Please take a look on Angular2 package for confirmation.

Workaround:
Currently we have to run gulp task to remove those files.

PS:
It will also fix issue #178

@valorkin
Copy link
Member

use TS 1.7.5 until ng2 supports 1.8
duplicate of #116

@SIGAN
Copy link
Author

SIGAN commented Feb 17, 2016

Please read carefully.

I have allowed unreachable code. It compiles and I don't see any compilation issues. And this actually doesn't matter.

The problem - is that it compiles ng2-bootstrap into my single file!
And I don't want to compile it, I want to use ng2-bootstrap.min.js package, which is included.

But because TS compiler sees *.ts files in folder, it treats them as sources to compile, instead of just to use *.d.ts files.

I don't want to compile it in, because then I can't cache ng2-bootstrap.min.js package using browser. And clients will have to download my code & code of ng2-bootstrap!

And one more point - if I just remove *.ts files from ng2-bootstrap subfolder of node_modules it will work as expected.

Do you see the point?

@valorkin
Copy link
Member

Yeap, just add to ignore .ts files from node modules ng2 folders

@SIGAN
Copy link
Author

SIGAN commented Feb 17, 2016

I have done it, but it ignores that parameter if you run with gulp-typescript :(

@valorkin
Copy link
Member

Can you add to ignore ts file from node modules in gulp files selector? (Blob)

@SIGAN
Copy link
Author

SIGAN commented Feb 18, 2016

No, they are already ignored, because my selector includes only my files...
But tsc will expand that because I've imported them.

@valorkin
Copy link
Member

Not cool, not cool at all
On Monday I will be back to speed, so will get back to this issue

On Thu, 18 Feb 2016, 20:19 Igor notifications@github.com wrote:

No, they are already ignored, because my selector includes only my files...
But tsc will expand that because I've imported them.


Reply to this email directly or view it on GitHub
#186 (comment)
.

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

No branches or pull requests

2 participants