forked from FlowFuse/node-red-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
43 lines (40 loc) · 1.24 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
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
import manifest from './manifest.json'
/**
* Vite is used to build the UI for the dashboard,
* is is not used for the nodes themselves.
*/
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
vue: 'vue/dist/vue.esm-bundler.js'
}
},
plugins: [vue(),
// VitePWA({ registerType: 'autoUpdate', devOptions: {
// enabled: true} })
VitePWA({
registerType: 'autoUpdate',
manifest,
includeAssets: ['favicon.svg', 'favicon.ico', 'apple-touch-icon.png', 'assets/*.png', 'assets/*.woff2', 'assets/*.woff', 'assets/*.ttf', 'assets/*.eot'],
// switch to "true" to enable sw on development
devOptions: {
enabled: false
},
workbox: {
maximumFileSizeToCacheInBytes: 3000000,
globPatterns: ['**/*.{js,css,html}', '**/*.{svg,png,jpg,gif,ttf,eot,woff,woff2}'],
cleanupOutdatedCaches: true
}
})
],
root: 'ui',
build: {
outDir: '../dist',
emptyOutDir: true
},
base: './'
})