Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 643
MHOOS Avatar asked Feb 25 '26 12:02

MHOOS


1 Answers

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.

like image 158
Nitesh Kumar Avatar answered Feb 28 '26 03:02

Nitesh Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!