jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.22k stars 507 forks source link

json files are missing in dist folder #970

Open InsaLili opened 3 years ago

InsaLili commented 3 years ago

Current Behavior

I have "resolveJsonModule": true in my tsconfig.json. I import and use several json files in my typescript files. If I run tsc, the json files are compiled to the dist folder. But if I run tsdx build, the json files are missing in the dist folder.

Expected behavior

json files should also be compiled to the dist folder when resolveJsonModule is set to true in tsconfig

Environment

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
    Memory: 825.05 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.13.0 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
  Browsers:
    Chrome: 88.0.4324.146
    Safari: 14.0.3
  npmGlobalPackages:
    typescript: 4.1.2
wildmolasses commented 3 years ago

+1 here. I also added json in my include array: ("include": ["src", "src/**/*.json", "types"]) which is normally a fix for tsc but it does not work with tsdx

the-homeless-god commented 3 years ago

+1

temp solution is the coping of json files using rollup-plugin-copy

https://www.npmjs.com/package/rollup-plugin-copy