Files
DashBoard/frontend/vite.config.js
egg a2653b8139 feat(wip): migrate WIP trio pages from Jinja2 to Vue 3 + Vite
Migrate /wip-overview, /wip-detail, and /hold-detail (1,941 lines vanilla JS)
to Vue 3 SFC architecture. Extract shared CSS/constants/components to
wip-shared/. Switch Pareto charts to vue-echarts with autoresize. Replace
Jinja2 template injection with frontend URL params + constant classification
for Hold Detail. Add 10-min auto-refresh + AbortController to Hold Detail.
Remove three Jinja2 templates, update Flask routes to send_from_directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 16:39:20 +08:00

56 lines
2.0 KiB
JavaScript

import { defineConfig } from 'vite';
import { resolve } from 'node:path';
import vue from '@vitejs/plugin-vue';
export default defineConfig(({ mode }) => ({
base: '/static/dist/',
plugins: [vue()],
publicDir: false,
build: {
outDir: '../src/mes_dashboard/static/dist',
emptyOutDir: false,
sourcemap: mode !== 'production',
rollupOptions: {
input: {
portal: resolve(__dirname, 'src/portal/main.js'),
'wip-overview': resolve(__dirname, 'src/wip-overview/index.html'),
'wip-detail': resolve(__dirname, 'src/wip-detail/index.html'),
'hold-detail': resolve(__dirname, 'src/hold-detail/index.html'),
'resource-status': resolve(__dirname, 'src/resource-status/main.js'),
'resource-history': resolve(__dirname, 'src/resource-history/main.js'),
'job-query': resolve(__dirname, 'src/job-query/main.js'),
'excel-query': resolve(__dirname, 'src/excel-query/main.js'),
tables: resolve(__dirname, 'src/tables/index.html'),
'query-tool': resolve(__dirname, 'src/query-tool/main.js'),
'tmtt-defect': resolve(__dirname, 'src/tmtt-defect/main.js'),
'qc-gate': resolve(__dirname, 'src/qc-gate/index.html')
},
output: {
entryFileNames: '[name].js',
chunkFileNames: 'chunks/[name]-[hash].js',
assetFileNames: '[name][extname]',
manualChunks(id) {
const normalizedId = id.replace(/\\/g, '/');
if (!normalizedId.includes('node_modules')) {
return;
}
if (
normalizedId.includes('/node_modules/echarts/') ||
normalizedId.includes('/node_modules/zrender/') ||
normalizedId.includes('/node_modules/vue-echarts/')
) {
return 'vendor-echarts';
}
if (
normalizedId.includes('/node_modules/vue/') ||
normalizedId.includes('/node_modules/@vue/')
) {
return 'vendor-vue';
}
return 'vendor';
}
}
}
}
}));