Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: tsconfig.json support multiple configurations. #11172

Closed
zengfenfei opened this issue Sep 27, 2016 · 3 comments
Closed

Suggestion: tsconfig.json support multiple configurations. #11172

zengfenfei opened this issue Sep 27, 2016 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@zengfenfei
Copy link

I want to generate both es5 and es6 versions of my TS project into different directories. But current tsconfig.json seems to support only one configuration. I suggest that tsconfig.json supports configuration like this(similar to webpack.config.js):

[
    {
        "compilerOptions": {
            "outDir": "./build/es5",
            "target": "es5"
        }
    },
    {
        "compilerOptions": {
            "outDir": "./build/es6",
            "target": "es6"
        }
    }
]
@kitsonk
Copy link
Contributor

kitsonk commented Sep 27, 2016

Essentially a dupe of #9876 which is the solution for complex configuration setting in a complex project.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 28, 2016

As noted by @kitsonk, configuration inheritance (i.e. using extends in a tsconfig.json file to inherit configurations) would be the solution here. you can use it if you are using typescript@next.

With that, you would have a master tsconfig.json file, and a set of overrides, tsconfig.es6.json and tsconfig.es5.json, etc.. you call the compiler on the override files, so tsc --p tsconfig.es6.json.

hope that helps.

@mhegazy mhegazy closed this as completed Sep 28, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Sep 28, 2016
@zengfenfei
Copy link
Author

@mhegazy Thanks, it works for me.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants