id
This commit is contained in:
@@ -1,11 +1,42 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
tailwindcss()
|
||||
],
|
||||
})
|
||||
plugins: [react()],
|
||||
server: {
|
||||
allowedHosts: true,
|
||||
},
|
||||
esbuild: {
|
||||
logOverride: {
|
||||
'ignored-directive': 'silent',
|
||||
},
|
||||
},
|
||||
logLevel: 'info',
|
||||
build: {
|
||||
rollupOptions: {
|
||||
onwarn(warning, warn) {
|
||||
// ignore certain harmless warnings
|
||||
if (
|
||||
warning.message.includes('Module level directives') ||
|
||||
warning.message.includes('"use client"') ||
|
||||
warning.message.includes('"was ignored"')
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// FAIL build on unresolved imports
|
||||
if (warning.code === 'UNRESOLVED_IMPORT') {
|
||||
throw new Error(`Build failed due to unresolved import:\n${warning.message}`);
|
||||
}
|
||||
|
||||
// FAIL build on missing exports (like your Input error)
|
||||
if (warning.code === 'PLUGIN_WARNING' && /is not exported/.test(warning.message)) {
|
||||
throw new Error(`Build failed due to missing export:\n${warning.message}`);
|
||||
}
|
||||
|
||||
// other warnings: log normally
|
||||
warn(warning);
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user