I've encountered an issue with my Angular2 library project where the test.ts
file is being included in the build, causing errors in Webstorm when decorators are used. The issue arises from the inclusion of both entry files (index.ts
and test.ts
) in my tsconfig.json
. Is there a way to configure the IDE to use tsconfig.json
for testing files but exclude them from the build process?
// tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
...
...
},
"files": [
"index.ts",
"test.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true
}
}
*Here are the build scripts for reference:
// package.json
...
"scripts": {
"cleanup": "rimraf dist/bundles dist/src dist/index.d.ts dist/index.js dist/index.js.map dist/LICENCE dist/README.md",
"bundling": "rollup -c",
"minify": "uglifyjs dist/bundles/my-library.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/async-local-storage.umd.min.js",
"copy": "copyfiles LICENSE README.md dist",
"build": "npm run cleanup && ngc && npm run bundling && npm run minify && npm run copy"
}
...