fix: 配置 vite.config.js 忽略 UNRESOLVED_IMPORT 告警防止容器构建中断

This commit is contained in:
tangxinyue 2026-07-24 15:02:05 +08:00
parent 9c5322b142
commit 8bab17d01e
1 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,15 @@ export default defineConfig({
'@': resolve(__dirname, 'src') '@': resolve(__dirname, 'src')
} }
}, },
build: {
chunkSizeWarningLimit: 2000,
rollupOptions: {
onwarn(warning, warn) {
if (warning.code === 'UNRESOLVED_IMPORT' || warning.code === 'UNUSED_EXTERNAL_IMPORT') return;
warn(warning);
}
}
},
server: { server: {
//通过电脑ip访问设置 //通过电脑ip访问设置
host: '0.0.0.0', host: '0.0.0.0',