I'm trying to convert a project from Angular 1 to Angular 2.
This is a client & server project with some common code (so I keep it together). I want to use Angular 2 on the client side so I followed the ng2 QuickStart. I am currently trying to build it inside my project.
I am using TSD
to manage my dependencies typings. Some of these dependencies like socket.io
rely on node.d.ts
.
My problem is that angular2
already expose node.d.ts
and create an ambient definition so when I want to use TSD
with angular2
I get a conflict between the two definitions :
typings\node\node.d.ts(961,9): error TS2300: Duplicate identifier 'path'.
Here is my gulp task :
gulp.task('build.conflict', function(){
var browserProject = tsc.createProject('browser.tsconfig.json', {
typescript: typescript
});
var src = [
'src/browser/**/*.ts',
'typings/**/*.d.ts' // commenting out this line results in unknown modules
];
var result = gulp.src(src)
.pipe(tsc(browserProject));
return result.js
.pipe(gulp.dest('build/browser'));
});
I also set up a simple repository demonstrating my issue.
How can I solve this error while still keeping my TSD
typings. (The best solution would be to prevent angular2
to expose its internal node.d.ts
)