Is this a bug report?
No. This is a feature request. Our team is now using CRA with TS and it is great! One thing we can't seem to find is any information on is having different TS compiler settings when doing a production build. Simply adding a tsconfig.prod.json appears to have no effect. I can't seem to find a documented way to add this and it would be super useful!
Did you try recovering your dependencies?
N/A
Which terms did you search for in User Guide?
TypeScript https://reactjs.org/docs/static-type-checking.html#typescript
Environment
Environment Info:
System:
OS: macOS 10.14.1
CPU: x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
Binaries:
Node: 10.14.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - ~/Projects/cirrus-admin-webapp/node_modules/.bin/npm
Browsers:
Chrome: 70.0.3538.110
Firefox: 63.0.3
Safari: 12.0.1
npmPackages:
@types/react: 16.7.7 => 16.7.7
@types/react-dom: 16.0.11 => 16.0.11
react: 16.6.3 => 16.6.3
react-dom: 16.6.3 => 16.6.3
react-scripts: 2.1.1 => 2.1.1
npmGlobalPackages:
create-react-app: Not Found
Steps to Reproduce
- Add TS to your project as outlined in the docs.
- Attempt to add a
tsconfig.prod.json with different settings than tsconfig.json:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noUnusedLocals": true
}
}
- Run
yarn build or whatever you have configured to do a production build with react-scripts
- Notice the settings aren't applied.
Expected Behavior
It would honor the tsconfig.prod.json
Actual Behavior
It honors the original tsconfig.json.
Reproducible Demo
N/A. I can add one later if people have any issues reproducing.
Is this a bug report?
No. This is a feature request. Our team is now using CRA with TS and it is great! One thing we can't seem to find is any information on is having different TS compiler settings when doing a production build. Simply adding a
tsconfig.prod.jsonappears to have no effect. I can't seem to find a documented way to add this and it would be super useful!Did you try recovering your dependencies?
N/A
Which terms did you search for in User Guide?
TypeScript https://reactjs.org/docs/static-type-checking.html#typescript
Environment
Steps to Reproduce
tsconfig.prod.jsonwith different settings thantsconfig.json:{ "extends": "./tsconfig.json", "compilerOptions": { "noUnusedLocals": true } }yarn buildor whatever you have configured to do a production build withreact-scriptsExpected Behavior
It would honor the
tsconfig.prod.jsonActual Behavior
It honors the original
tsconfig.json.Reproducible Demo
N/A. I can add one later if people have any issues reproducing.