Recently, I've been working on a project in VS 2015 update 3 and just integrated Typescript 2.0.
Initially, I encountered a lot of errors and had to go through a trial and error process to resolve them. Now, all the errors have been fixed but I'm facing an issue with my output file.
All my source files are located in the client folder, which is situated in the root directory of the project.
Here's a glimpse of my tsconfig.json:
{
"compileOnSave": true,
"compilerOptions": {
"module": "amd",
"noImplicitAny": true,
"noEmitOnError": true,
"moduleResolution": "node",
"removeComments": true,
"sourceMap": true,
"target": "es5",
"outDir": "./client",
"outFile": "./client/app.js",
"sourceRoot": "./client"
},
"exclude": [
"node_modules",
"wwwroot"
]
}
The project successfully compiled when it was using version 1.8.x.
For instance, take a look at one of my .ts files:
namespace app {
'use strict';
angular
.module('app', [
'ngRoute',
'ngAnimate',
'officeuifabric.core',
'officeuifabric.components'
]);
}
Could there be something that I'm overlooking?
---edit--- I noticed that if I remove these lines:
"outDir": "./client",
"outFile": "./client/app.js",
"sourceRoot": "./client"
the build process runs smoothly without any issues. Are these parameters still valid?
--edit 2-- I also experimented with an empty project in VS Code and the tsc command line tool.
Here's the tsconfig configuration that works:
{
"compileOnSave": true,
"compilerOptions": {
"module": "amd",
"noImplicitAny": true,
"noEmitOnError": true,
"moduleResolution": "node",
"removeComments": true,
"sourceMap": true,
"target": "es5",
"outFile": "app.js",
"sourceRoot": "./client"
},
"exclude": [
"node_modules"
]
}
However, whenever I add Outdir, either nothing gets compiled or it ends up in the wrong location.
One solution that does work is:
"outFile": "./build/app.js",