mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 12:20:38 +01:00
Uses the layout of the build artifact directory to infer the format of a given file, and which lint rules to apply. This has the effect of decoupling the lint build job from the existing Rollup script, so that if we ever add additional post-processing, or if we replace Rollup, it will still work. But the immediate motivation is to replace the separate "stable" and "experimental" lint-build jobs with a single combined job.
15 lines
417 B
Bash
Executable File
15 lines
417 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)' -- './build2/*')
|
|
|
|
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
|