Replies: 1 comment
-
You need to add your test file pattern to the excludes in tsconfig.json. ie: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm trying to reduce the number of packages installed during production builds. One way I've done this before is by splitting non-build dependencies (e.g. test-only dependencies) into
devDependencies
, and then runningyarn install --production
during builds.This used to work with react-scrips v4, but w/ react-scrips v5 I see an error when I try to build. Also, note: this is a problem with the TS template, so I'm guessing that some default behavior changed for how TS compilation works from 4=>5.
To reproduce:
npx create-react-app test-app --template typescript
package.json
and move@testing-library/react
into thedevDependencies
rm -rf node_modules
) and runyarn install --production
yarn run build
Ideas for workarounds:
exclude
s test files. Doesn't seem to be supported: Add a way to specify an alternate tsconfig for production builds #6023Beta Was this translation helpful? Give feedback.
All reactions