forked from trent_larson/crowd-funder-for-time-pwa
feat(build): add comprehensive ESBuild error handling to Vite configurations
- Add ESBuild logLevel: 'error' to all Vite configs - Configure logOverride for critical errors: duplicate-export, duplicate-member, syntax-error, invalid-identifier - Ensure builds fail immediately on ESBuild compilation errors - Apply to common, web, and optimized Vite configurations Prevents broken code from being deployed due to build-time errors
This commit is contained in:
@@ -112,4 +112,28 @@ export async function loadAppConfig(): Promise<AppConfig> {
|
||||
"dexie-export-import/dist/import/index.js",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Shared ESBuild configuration that ensures builds fail on errors
|
||||
*/
|
||||
export function getStrictESBuildConfig() {
|
||||
return {
|
||||
target: 'es2015',
|
||||
supported: {
|
||||
'bigint': true
|
||||
},
|
||||
// Fail on any ESBuild errors
|
||||
logLevel: 'error' as const,
|
||||
// Ensure build fails on syntax errors and other critical issues
|
||||
logOverride: {
|
||||
'duplicate-export': 'error',
|
||||
'duplicate-member': 'error',
|
||||
'syntax-error': 'error',
|
||||
'invalid-identifier': 'error'
|
||||
},
|
||||
// Additional strict settings
|
||||
keepNames: false,
|
||||
minifyIdentifiers: false
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user