I am currently working on integrating Angular2 with Laravel 5.2 and facing an issue with configuring gulp to compile typescript files.
Below is a snippet from my package.json file:
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
...
},
"dependencies": {
...
}
}
This is the content of my tsconfig.json file (located in resources/assets/typescript):
{
"compilerOptions": {
...
},
"exclude": [
"node_modules"
]
}
Finally, here is my gulpfile.js code snippet:
...
Upon running gulp from the console, I encountered errors like:
/var/www/chat/laravel/node_modules/@angular/common/src/directives/ng_class.d.ts(81,34): error TS2304: Cannot find name 'Set'.
[14:59:24] gulp-notify: [Laravel Elixir] TypeScript Compilation Failed!: /var/www/chat/laravel/node_modules/@angular/common/src/directives/ng_class.d.ts(81,34): error TS2304: Cannot find name 'Set'.
{ [TypeScript error: /var/www/chat/laravel/node_modules/@angular/common/src/directives/ng_class.d.ts(81,34): error TS2304: Cannot find name 'Set'.]
name: 'TypeScript error',
.....
The error seems to be related to compiling TypeScript files located inside node_modules directory despite specifying exclusions in the tsconfig.json file.