0

I've used Angular Quickstart example as a beginning for my angular 2 application. I'm currently trying to compile files in a separate directory to avoid the mess of .ts and .js files being mixed and I didn't a way to do it with the tools proposed.

I would like to know if anyone has met the problem before switching to a regular gulp/grunt compilation.

1 Answer 1

1

I had this same problem. Check it out in this issue someone raised. Link to Github issue

Simply specify the directory (outDir) in tsconfig.json like shown below.

{
    "version": "1.7.3",
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "declaration": false,
        "noImplicitAny": true,
        "suppressImplicitAnyIndexErrors": true,
        "removeComments": false,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "noEmitOnError": false,
        "preserveConstEnums": true,
        "inlineSources": false,
        "sourceMap": false,
        "outDir": "./dist",
        "rootDir": "./src",
        "project": "./src",
        "moduleResolution": "node",
        "listFiles": false
    },
    "exclude": [
        "node_modules",
        "jspm_packages",
        "typings/browser",
        "typings/browser.d.ts"
    ]
}

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the solution ! it works. I just added a precision on how to call the new JS files that we obtain in this configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.