Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tsc creates src folder in dist

I have this folder structure:

- src
 - subdir1
 - subdir2

This is my tsconfig.json:

{
  "compilerOptions": {
    "target": "es2015",
    "module": "commonjs",
    "sourceMap": true,
    "declaration": true,
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "types": [
      "mocha",
      "node"
    ]
  }
}

Calling ./node_modules/.bin/tsc results in this folder structure:

- dist
  - src
   - subdir1
   - subdir2
- src
 - subdir1
 - subdir2

Why is src included in dist?

like image 678
Alexander Zeitler Avatar asked Oct 24 '25 12:10

Alexander Zeitler


1 Answers

I ran the same thing and in fact it is a building error. In my case, i needed to get information of a file that was outside of 'src'.

Therefore, the TSC created the dir 'src' because my code "needed" to access something outside the folder 'src'.

like image 105
Manuel Dias Avatar answered Oct 26 '25 02:10

Manuel Dias



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!