forked from fluidd-core/fluidd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
129 lines (122 loc) · 2.96 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue2'
import { VitePWA } from 'vite-plugin-pwa'
import Components from 'unplugin-vue-components/vite'
import { VuetifyResolver } from 'unplugin-vue-components/resolvers'
import path from 'path'
import content from '@originjs/vite-plugin-content'
import monacoEditorPlugin from 'vite-plugin-monaco-editor'
import checker from 'vite-plugin-checker'
import version from './vite.config.inject-version'
export default defineConfig({
plugins: [
VitePWA({
registerType: 'autoUpdate',
includeAssets: [
'**/*.svg',
'**/*.png',
'**/*.ico',
'*.json'
],
workbox: {
globPatterns: [
'**/*.{js,css,html,ttf,woff,woff2}'
],
maximumFileSizeToCacheInBytes: 4 * 1024 ** 2,
navigateFallbackDenylist: [
/^\/websocket/,
/^\/(printer|api|access|machine|server)\//,
/^\/webcam[2-4]?\//
]
},
manifest: {
name: 'fluidd',
short_name: 'fluidd',
description: 'The Klipper web interface for managing your 3d printer',
theme_color: '#2196F3',
background_color: '#000000',
icons: [
{
src: '/img/icons/android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: '/img/icons/android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png'
},
{
src: '/img/icons/android-chrome-maskable-192x192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'maskable'
},
{
src: '/img/icons/android-chrome-maskable-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable'
}
]
},
devOptions: {
enabled: true
}
}),
vue(),
version(),
content(),
monacoEditorPlugin({
languageWorkers: ['editorWorkerService', 'json', 'css']
}),
checker({
vueTsc: {
tsconfigPath: path.resolve(__dirname, './tsconfig.app.json')
}
}),
Components({
dts: true,
dirs: [
'src/components/common',
'src/components/layout',
'src/components/ui'
],
resolvers: [
VuetifyResolver()
]
})
],
css: {
preprocessorOptions: {
css: { charset: false },
sass: {
additionalData: [
'@import "@/scss/variables.scss"',
''
].join('\n')
}
}
},
envPrefix: 'VUE_',
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: [
'./tests/unit/setup.ts'
],
alias: [
{ find: /^vue$/, replacement: 'vue/dist/vue.runtime.common.js' }
]
},
server: {
host: '0.0.0.0',
port: 8080
}
})