From cbddbeb0a158e9f7f1083341e0d1719fc5f3238d Mon Sep 17 00:00:00 2001 From: SunWuyuan Date: Wed, 11 Jun 2025 16:41:22 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=B7=BB=E5=8A=A0=E5=A3=81=E7=BA=B8?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=8C=E4=B8=8D=E6=9E=84=E5=BB=BAsw"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 183214305540d86e56c34316ec52523d04af4ab2. --- vite.config.mjs | 74 ++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 44 deletions(-) diff --git a/vite.config.mjs b/vite.config.mjs index 8641534..7d6e4b4 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -13,21 +13,15 @@ import { defineConfig } from 'vite' import { fileURLToPath, URL } from 'node:url' // https://vitejs.dev/config/ -export default defineConfig(({ mode }) => { - // 从命令行参数中获取 wallpaper 模式 - const isWallpaper = mode === 'wallpaper'; - - const plugins = [ +export default defineConfig({ + base: './', + plugins: [ VueRouter(), Layouts(), Vue({ template: { transformAssetUrls } - }) - ]; - - // 只在非壁纸模式下启用 PWA - if (!isWallpaper) { - plugins.push(VitePWA({ + }), + VitePWA({ registerType: 'autoUpdate', devOptions: { navigateFallback: 'index.html', @@ -179,10 +173,7 @@ export default defineConfig(({ mode }) => { }, ], } - })); - } - - plugins.push( + }), // https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#readme Vuetify({ autoImport: true, @@ -208,36 +199,31 @@ export default defineConfig(({ mode }) => { enabled: true, }, vueTemplate: true, - }) - ); - - return { - base: './', - plugins, - define: { 'process.env': {} }, - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) - }, - extensions: [ - '.js', - '.json', - '.jsx', - '.mjs', - '.ts', - '.tsx', - '.vue', - ], + }), + ], + define: { 'process.env': {} }, + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) }, - server: { - port: 3031, - }, - css: { - preprocessorOptions: { - sass: { - api: 'modern-compiler', - }, + extensions: [ + '.js', + '.json', + '.jsx', + '.mjs', + '.ts', + '.tsx', + '.vue', + ], + }, + server: { + port: 3031, + }, + css: { + preprocessorOptions: { + sass: { + api: 'modern-compiler', }, }, - } + }, })