Add option to disable vite checker via env variable

Introduced the DISABLE_VITE_CHECKER environment variable to conditionally disable the vite checker plugin in the build process. Updated the Dockerfile to set this variable during the Docker build, allowing builds to bypass vite checker when needed.
This commit is contained in:
Yuzhong Zhang
2025-07-05 23:45:23 +08:00
parent 96ac0f1a2d
commit 999465cc50
2 changed files with 14 additions and 12 deletions
+13 -11
View File
@@ -51,17 +51,19 @@ export default defineConfig({
},
plugins: [
react(),
checker({
typescript: true,
eslint:
envVars.VITE_APP_ENABLE_ESLINT === "false"
? undefined
: { lintCommand: 'eslint "./**/*.{js,ts,tsx}"' },
overlay: {
initialIsOpen: envVars.VITE_APP_COLLAPSE_OVERLAY === "false",
badgeStyle: "margin-bottom: 4rem; margin-left: 1rem",
},
}),
process.env.DISABLE_VITE_CHECKER
? undefined
: checker({
typescript: true,
eslint:
envVars.VITE_APP_ENABLE_ESLINT === "false"
? undefined
: { lintCommand: 'eslint "./**/*.{js,ts,tsx}"' },
overlay: {
initialIsOpen: envVars.VITE_APP_COLLAPSE_OVERLAY === "false",
badgeStyle: "margin-bottom: 4rem; margin-left: 1rem",
},
}),
svgrPlugin(),
ViteEjsPlugin(),
VitePWA({