Search code examples
typescripttypescript1.8

Multiple tsconfig on a Visual Studio 2015 Project [typescript 1.8]


I have a MVC 5 project where I use typescript. Now I have to implements new features I it open other typescript implementation way. I'm trying to use multiple tsconfig.json file new feature of typescript 1.8, I have two folders: typescriptE21 and typescript, and a tsconfig.json file on each folder.

The first:

{
    "compilerOptions": {
        "removeComments": false,
        "sourceMap": false,
        "target": "es5",
        "noImplicitAny": false,
        "module": "amd",
        "declaration": false,
        "noEmitOnError": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "inlineSourceMap": true,
        "inlineSources": true
    },
    "compileOnSave": true,
    "exclude": [
        "node_modules",
        "typescript"
    ]
}

and the second:

{
    "compilerOptions": {
        "removeComments": false,
        "sourceMap": false,
        "target": "es5",
        "noImplicitAny": false,
        "module": "system",
        "declaration": false,
        "noEmitOnError": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "inlineSourceMap": true,
        "inlineSources": true
    },
    "compileOnSave": true,
    "exclude": [
        "node_modules",
        "typescript21",
        "scripts"
    ]
}

When I open the project properties on Typescript section says "One or more tsconfig.json files detected. Project properties are disabled." that's correct but when I run the application I get this error:

Build: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning

On this file:

import {Component} from "ngts/ngts";

@Component({
    template: `<div md-scroll-y flex class="md-padding" id="contenido">Contenido</div>`
})
export class EmAplicacion {

}

In both tsconfig.json files I have activated the decorators but seems that typescript doesn't get the compiler options from there ...

In addition, when I don't use decorators, It compiles but I can see the result files and they are emited using AMD module system when I have put "system" in the second config file ...

What's the problem?


Solution

  • The real problem is that tsconfig.json files are included on prject as:

    <None Include="typescript\tsconfig.json" />
    

    I have change it by;

    <Content Include="typescript\tsconfig.json" />
    

    And all it's ok