mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2025-07-02 00:59:23 +00:00
Revert "添加壁纸模式,不构建sw"
This reverts commit 183214305540d86e56c34316ec52523d04af4ab2.
This commit is contained in:
parent
1832143055
commit
cbddbeb0a1
@ -13,21 +13,15 @@ import { defineConfig } from 'vite'
|
|||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig({
|
||||||
// 从命令行参数中获取 wallpaper 模式
|
base: './',
|
||||||
const isWallpaper = mode === 'wallpaper';
|
plugins: [
|
||||||
|
|
||||||
const plugins = [
|
|
||||||
VueRouter(),
|
VueRouter(),
|
||||||
Layouts(),
|
Layouts(),
|
||||||
Vue({
|
Vue({
|
||||||
template: { transformAssetUrls }
|
template: { transformAssetUrls }
|
||||||
})
|
}),
|
||||||
];
|
VitePWA({
|
||||||
|
|
||||||
// 只在非壁纸模式下启用 PWA
|
|
||||||
if (!isWallpaper) {
|
|
||||||
plugins.push(VitePWA({
|
|
||||||
registerType: 'autoUpdate',
|
registerType: 'autoUpdate',
|
||||||
devOptions: {
|
devOptions: {
|
||||||
navigateFallback: 'index.html',
|
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
|
// https://github.com/vuetifyjs/vuetify-loader/tree/master/packages/vite-plugin#readme
|
||||||
Vuetify({
|
Vuetify({
|
||||||
autoImport: true,
|
autoImport: true,
|
||||||
@ -208,36 +199,31 @@ export default defineConfig(({ mode }) => {
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
vueTemplate: true,
|
vueTemplate: true,
|
||||||
})
|
}),
|
||||||
);
|
],
|
||||||
|
define: { 'process.env': {} },
|
||||||
return {
|
resolve: {
|
||||||
base: './',
|
alias: {
|
||||||
plugins,
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
define: { 'process.env': {} },
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
||||||
},
|
|
||||||
extensions: [
|
|
||||||
'.js',
|
|
||||||
'.json',
|
|
||||||
'.jsx',
|
|
||||||
'.mjs',
|
|
||||||
'.ts',
|
|
||||||
'.tsx',
|
|
||||||
'.vue',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
server: {
|
extensions: [
|
||||||
port: 3031,
|
'.js',
|
||||||
},
|
'.json',
|
||||||
css: {
|
'.jsx',
|
||||||
preprocessorOptions: {
|
'.mjs',
|
||||||
sass: {
|
'.ts',
|
||||||
api: 'modern-compiler',
|
'.tsx',
|
||||||
},
|
'.vue',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
port: 3031,
|
||||||
|
},
|
||||||
|
css: {
|
||||||
|
preprocessorOptions: {
|
||||||
|
sass: {
|
||||||
|
api: 'modern-compiler',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user