As soon as I import either Select or SELECT_DIRECTIVES I get the following compile errors
error TS6059: File '/node_modules/ng2-select/components/select.ts' is not under 'rootDir' 'src'. 'rootDir' is expected to contain all source files.
error TS6059: File '/node_modules/ng2-select/components/select/select-interfaces.ts' is not under 'rootDir' 'src'. 'rootDir' is expected to contain all source files.
error TS6059: File '/node_modules/ng2-select/components/select/select-item.ts' is not under 'rootDir' 'src'. 'rootDir' is expected to contain all source files.
error TS6059: File '/node_modules/ng2-select/components/select/select-pipes.ts' is not under 'rootDir' 'src'. 'rootDir' is expected to contain all source files.
error TS6059: File '/node_modules/ng2-select/components/select/select.ts' is not under 'rootDir' 'src'. 'rootDir' is expected to contain all source files.
Here is my tsconfig
{
"compilerOptions": {
"rootDir": "src",
"outDir": "build",
"target": "ES5",
"module": "system",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"exclude": [
"node_modules",
"typings/browser.d.ts",
"typings/browser"
]
}
+1
+1
This seems to be due to .ts and .d.ts files existing within the same directory and causing the typescript compiler to recompile the module and then getting confused because it is outside of the rootDir.
I found this ng2-bootstrap issue that appears to be the same problem.
I forked the repo and was about to look in to fixing the issue when I noticed this commit, which seems like it may be the fix that I was looking for due to the .npmignore modifications. However I can't test using npm install ng2-select or npm install valor-software/ng2-select, is there an npm release coming up?
check out latest version
no .ts files in npm :)
I can confirm the latest release fixes the issue, thanks!
awesome!
Most helpful comment
+1