This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
vite.config.ts
70 lines (68 loc) · 1.75 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { createHtmlPlugin } from 'vite-plugin-html'
import { VitePWA } from "vite-plugin-pwa";
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
VueI18nPlugin({
include: [fileURLToPath(new URL('./src', import.meta.url)) + '/**/*.vue'],
}),
VitePWA({
registerType: 'autoUpdate',
injectRegister: 'inline',
includeAssets: ['favicon.ico', 'icon.png', 'background.webp'],
manifest: {
name: 'Fystart',
short_name: 'Fystart',
theme_color: '#1E1E1EFF',
icons: [{
src: 'icon.png',
sizes: '192x192',
type: 'image/png',
}],
},
workbox: {
clientsClaim: true,
skipWaiting: true,
cleanupOutdatedCaches: true,
globPatterns: ['**/*.{js,css,html,webp,png}'],
globDirectory: 'dist',
runtimeCaching: [{
urlPattern: new RegExp('^https://open.lightxi.com/'),
handler: "CacheFirst",
options: {
cacheName: "lightxi-cdn",
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365,
}
}
}],
},
devOptions: {
enabled: true,
}
}),
createHtmlPlugin({
minify: true,
}),
],
build: {
manifest: true,
rollupOptions: {
output: {
entryFileNames: `assets/[name].[hash].js`,
chunkFileNames: `assets/[name].[hash].js`,
},
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
}
}
})