Files
Auto_Bangumi/webui/vite.config.ts
Estrella Pan 5382aec8dc feat: add first-run setup wizard with guided configuration
Add a multi-step setup wizard that guides new users through initial
configuration on first run. The wizard covers account credentials,
download client connection (with test), RSS source, media paths,
and optional notification setup.

Backend: new /api/v1/setup/ endpoints with sentinel file mechanism.
Frontend: 7-step wizard with validation and i18n (en/zh-CN).

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-01-24 08:16:41 +01:00

128 lines
3.0 KiB
TypeScript

import { resolve } from 'node:path';
import UnoCSS from 'unocss/vite';
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 VueRouter from 'unplugin-vue-router/vite';
import { VueRouterAutoImports } from 'unplugin-vue-router';
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
import { VitePWA } from 'vite-plugin-pwa';
import VueJsx from '@vitejs/plugin-vue-jsx';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
base: './',
plugins: [
VueJsx(),
VueRouter({
dts: 'types/dts/router-type.d.ts',
}),
vue({
script: {
defineModel: true,
},
}),
UnoCSS(),
AutoImport({
imports: [
'vue',
'vitest',
'pinia',
{
'@vueuse/core': [
'createSharedComposable',
'useBreakpoints',
'usePreferredDark',
'useClipboard',
'useLocalStorage',
'useIntervalFn',
],
},
VueRouterAutoImports,
'vue-i18n',
],
dts: 'types/dts/auto-imports.d.ts',
dirs: ['src/api', 'src/store', 'src/hooks', 'src/utils'],
}),
Components({
dts: 'types/dts/components.d.ts',
dirs: [
'src/components',
'src/components/basic',
'src/components/layout',
'src/components/setting',
'src/components/setup',
],
}),
VueI18nPlugin({
include: resolve(__dirname, './src/i18n/**'),
}),
VitePWA({
injectRegister: false,
registerType: 'autoUpdate',
devOptions: {
enabled: true,
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
},
manifest: {
name: 'AutoBangumi',
display: 'standalone',
short_name: 'AutoBangumi',
description: 'Automated Bangumi Download Tool',
theme_color: '#ffffff',
icons: [
{
src: '/images/logo.svg',
sizes: 'any',
type: 'image/svg+xml',
purpose: 'any',
},
{
src: '/images/pwa-192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/images/pwa-512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any',
},
],
},
}),
],
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "./src/style/mixin.scss";',
},
},
},
esbuild: {
drop: mode === 'production' ? ['console', 'debugger'] : [],
},
build: {
cssCodeSplit: false,
},
resolve: {
alias: {
'~': resolve(__dirname, './'),
'@': resolve(__dirname, 'src'),
'#': resolve(__dirname, 'types'),
},
},
server: {
proxy: {
'^/api/.*': {
target: 'http://localhost:7892',
changeOrigin: false,
},
'^/posters/.*': 'http://localhost:7892',
},
},
}));