react/scripts/circleci/check_minified_errors.sh
Andrew Clark 30b1a8009c
Don't extract errors in CI (#15758)
Removes `--extract-errors` argument from CI build script command.
Instead, the author is expected to run `yarn extract-errors` locally
or manually edit the error code map.

The lint rule should be sufficient to catch unminified errors, but
as an extra precaution, I added a post-build step that greps the
production bundles. The post-build step works even if someone disables
the lint rule for a specific line or file.
2019-05-29 14:20:29 -07:00

15 lines
416 B
Bash
Executable File

#!/bin/bash
# Ensure errors are minified in production
OUT=$(git --no-pager grep -n --untracked --no-exclude-standard 'FIXME (minify-errors-in-prod)' -- './build/*')
if [ "$OUT" != "" ]; then
echo "$OUT";
echo -e "\n";
echo "Detected an unminified error message in the production build. User-facing errors message must have a corresponding error code in scripts/error-codes/codes.json."
exit 1
fi
exit 0