I am developing an angular cli v6 project in visual studio 2017 and noticing that unwanted .js and .js.map`files are being generated for some of my typescript files in the same folder. (I don't want any generated)
I am noticing that any files inside of folders named after angular elements ('services', 'resolvers', 'components','directives') don't seem to create these extra files.
For example, if I create my-component.component.ts within the components folder, no extra js/js.map files are generated.
My question is twofold:
- What is the criteria that determines if these extra files are generated?
- How do I prevent them from being generated
Project File structure (showing unwanted files)
src
|-- app
| |-- components (no generated js/js.map files here)
| | |-- my-component.component.ts
| |
| |-- resolvers (no generated js/js.map files here)
| | |-- my-resolver.resolver.ts
| |
| |-- services (no generated js/js.map files here)
| | |-- my-service.service.ts
| |
| |-- types (has generated js/js.map files)
| | |-- my-type.type.js **dont want this file!**
| | |-- my-type.type.js.map **dont want this file!**
| | |-- my-type.type.ts
Here is my tsconfig.json
file
ClientApp/tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
ClientApp/src/tsconfig.app.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
ClientApp/src/tsconfig.spec.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"baseUrl": "./",
"module": "commonjs",
"types": [
"jasmine",
"node"
]
},
"files": [
"test.ts",
"polyfills.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
ClientApp/e2e/tsconfig.e2e.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}