-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
71 lines (70 loc) · 1.87 KB
/
vite.config.js
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
71
import { vitePluginForArco } from '@arco-plugins/vite-vue'
import vue from '@vitejs/plugin-vue'
import copy from 'rollup-plugin-copy'
import visualizer from 'rollup-plugin-visualizer'
import { defineConfig } from 'vite'
import viteCompression from 'vite-plugin-compression'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
plugins: [
vue(),
vitePluginForArco({ theme: '@arco-themes/vue-boxy', style: true }),
copy({
targets: [
{ src: './src/assets/mimeng.png', dest: './dist' },
{ src: './src/assets/favicon.ico', dest: './dist' },
{ src: './src/assets/mimeng.png', dest: './dist' },
{ src: './node_modules/blockly/media/*', dest: './dist/media' },
{ src: 'NOTICE', dest: './dist' }
],
hook: 'writeBundle'
}),
VitePWA({
mode: 'production',
base: '/',
registerType: 'prompt',
injectRegister: 'auto',
workbox: {
runtimeCaching: [
{
urlPattern: /.*/i,
handler: 'NetworkFirst',
options: {
cacheName: 'boxy-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 30
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
},
manifest: {
name: 'LuaMaker',
short_name: 'LuaMaker',
description: 'This program built on Boxy.',
theme_color: '#4062f6',
start_url: './',
id: 'LuaMaker',
icons: [
{
src: 'mimeng.png',
sizes: '512x512',
purpose: 'any maskable'
},
{
src: 'favicon.ico',
sizes: '256x256'
}
]
}
}),
viteCompression({
threshold: 1024 * 1024
}),
visualizer()
]
})