Files
crawler-plugin/frontend-vue/vite.config.ts
T
huangzd1997 e248b6e43a feat(web): 前端 SPA 化 + 工具页任务面板统一与历史批量删除
- SPA 化:22 个 MPA html 入口与 *-main.ts 合并为 index.html + vue-router(URL 无 .html 后缀),
  页面跳转全部 router-link,/new_web_source/xxx.html 旧路径归一为 /xxx
- 任务面板统一:共享 TaskCenterPanel/TaskItemCard/TaskStatCards/HistoryTaskLayer,
  16 个工具页右侧统一为统计卡 + 当前任务 + 历史任务弹层(任务ID/开始/结束/状态必展示)
- 历史记录支持单条删除 + 批量勾选删除(确认框/全选/失败提示)
- Java 7 模块(dedupe/convert/split/productrisk/shopmatch/pricetrack/deletebrand)
  history 接口补齐任务时间字段(VO+Service,复用 biz_file_task 列)
- 图片工作台/API 层(brand/permission/user)既有未提交改动一并提交
2026-09-08 10:02:55 +08:00

67 lines
2.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { fileURLToPath, URL } from 'node:url'
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig({
base: '/',
plugins: [
vue(),
AutoImport({
imports: ['vue', 'vue-router'],
resolvers: [ElementPlusResolver()],
dts: 'auto-imports.d.ts',
vueTemplate: true,
}),
Components({
resolvers: [ElementPlusResolver()],
dts: 'components.d.ts',
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
port: 5173,
proxy: {
'/newApi/api': {
target: process.env.VITE_API_TARGET || 'http://127.0.0.1:18080/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/newApi/, ''),
},
// /login、/check_login、/logout 等无 /api 前缀的 Java 接口(登录/用户信息)
'/newApi/login': {
target: process.env.VITE_API_TARGET || 'http://127.0.0.1:18080/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/newApi/, ''),
},
'/newApi/check_login': {
target: process.env.VITE_API_TARGET || 'http://127.0.0.1:18080/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/newApi/, ''),
},
},
},
build: {
outDir: 'new_web_source',
emptyOutDir: true,
cssCodeSplit: true,
rollupOptions: {
// SPA 单入口(2026-09-08):原 22 个 MPA 入口已合并为 index.html + 路由
input: resolve(__dirname, 'index.html'),
output: {
// 入口文件同样带内容 hash/assets/ 静态服务配了 immutable 长缓存,
// 无 hash 的入口文件会导致前端更新对用户永不生效(旧文件名被永久缓存)
entryFileNames: 'assets/[name]-[hash].js',
chunkFileNames: 'assets/[name]-[hash].js',
assetFileNames: 'assets/[name]-[hash][extname]',
},
},
},
})