MHOOS
MHOOS

Reputation: 5306

where are the transpiled js files when using Angular CLI

In an angular 5 project created by the help of the Angular CLI 1.5.0, when I run the following command

ng serve

I can see that web pack starts its bundling and projects starts serving. Where does the generated transpiled js file go to? Initially I thought this location should be the one mentioned in

tsconfig.json , OutDir

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "baseUrl": "src",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es2017",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

but funnily enough I can't seem to find that outdir folder inside the project folder. I've also checked the angular-cli.json file

  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      ......
      ......   

but I still can't find the transpiled js files. What am I missing or doing wrong? Where are the java-script files for my .ts files?

Upvotes: 3

Views: 2156

Answers (1)

Nitesh Kumar
Nitesh Kumar

Reputation: 1774

ng serve keeps transpiled files in memory and does not write to disk. You need to do ng build --watch to get it to write to disk and also update with changes.

Upvotes: 2

Related Questions