0.16.0 Pre-Release Checks
This commit is contained in:
+19
-1
@@ -1,5 +1,5 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { defineConfig } from 'vite';
|
||||
import { createLogger, defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
const appPackage = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
||||
@@ -24,8 +24,26 @@ if (publicOrigin) {
|
||||
};
|
||||
}
|
||||
|
||||
const viteLogger = createLogger();
|
||||
const customLogger = {
|
||||
...viteLogger,
|
||||
error(message, options) {
|
||||
const text = String(message || '');
|
||||
const stack = String(options?.error?.stack || '');
|
||||
const isWsProxyMessage = text.includes('ws proxy socket error');
|
||||
const isEpipe = text.includes('EPIPE') || stack.includes('EPIPE');
|
||||
|
||||
if (isWsProxyMessage && isEpipe) {
|
||||
return;
|
||||
}
|
||||
|
||||
viteLogger.error(message, options);
|
||||
}
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
customLogger,
|
||||
define: {
|
||||
__APP_VERSION__: JSON.stringify(appPackage.version)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user