fix: enforce production React release builds
CSS quality / css-quality (push) Has been cancelled

This commit is contained in:
hectorzhao
2026-09-08 22:39:32 +08:00
parent 6816f56178
commit 809175b544
6 changed files with 100 additions and 2 deletions
+12 -1
View File
@@ -5,7 +5,18 @@ import path from 'path';
const apiProxyTarget = process.env.API_PROXY_TARGET ?? 'http://localhost:3000';
export default defineConfig({
plugins: [react()],
plugins: [
react(),
{
name: 'cmpp-production-build-guard',
apply: 'build',
configResolved(config) {
if (!config.isProduction) {
throw new Error('CMPP frontend builds require NODE_ENV=production; refusing a development React release.');
}
},
},
],
cacheDir: 'node_modules/.vite-cmpp',
resolve: {
alias: {