1

I have a project in express/typescript and in my root directory backend, the files .json dont save in the folder dist

tsconfig.json

{


"compilerOptions": {
    "module": "commonjs",
    "esModuleInterop": true,
    "target": "es6",
    "moduleResolution": "node",
    "sourceMap": true,
    "outDir": "dist",
    "resolveJsonModule": true
  },
  "lib": ["es2015"]
}

tslint.json

  {
    "defaultSeverity": "error",
    "extends": ["tslint:recommended"],
    "jsRules": {},
    "rules": {
      "no-console": false
    },
    "rulesDirectory": []
  }

root Directory

  • appsettings.development.json -> This files are not saved inthe dist folder
  • appsettings.json -> This files are not saved in the dist folder
  • swagger.json -> This files are not saved in the dist folder
  • tsconfig.json
  • tslint.json
  • dist

Directory order:

enter image description here

JOSE HERRADA
  • 149
  • 2
  • 8
  • Does this answer your question? [How to copy non-ts files to dist when building typescript?](https://stackoverflow.com/questions/60306654/how-to-copy-non-ts-files-to-dist-when-building-typescript) – Liam Sep 17 '21 at 13:33
  • No, that answer doesn't work – JOSE HERRADA Sep 17 '21 at 13:39

1 Answers1

0

I think that's what it's supposed to do. Whatever you put on tsconfig.json is used by the Typescript compiler, which compiles ts files to js. It doesn't do anything with other files.

tslint.json has nothing to do with your issue, it's for setting linting rules.

What you want to achieve is usually done by extending your npm scripts with some shell commands like "cp" or by using a bundler like webpack, rollup, etc.

Ronald
  • 68
  • 8