-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathvite.config.js
63 lines (59 loc) · 2.3 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
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { VitePWA as pwa } from 'vite-plugin-pwa';
import dynamicImport from 'vite-plugin-dynamic-import';
import { version } from './package.json';
import { resolve } from 'path';
const path = (...p) => resolve(__dirname, ...p);
const isDev = process.env.NODE_ENV === 'development';
const currentDate = new Date();
export default defineConfig({
base: (isDev ? '/' : `/HadesSpace/`),
server: {
port: 8080,
},
define: {
'__APP_VERSION__': JSON.stringify(version),
'__BUILD_TIMESTAMP__': currentDate.getTime(),
},
resolve: {
alias: {
'@': path('src'),
'@Data': path('parser/dist'),
'@i18n': path('i18n/dist'),
'@Regulation': path('src/regulation'),
'@Img': path('src/img'),
'@Utils': path('src/utils'),
'@Handlers': path('src/utils/Handlers'),
},
},
assetsInclude: ['**/*.md', '**/community/tables/*.md', '**/*.yml'],
plugins: [
dynamicImport(),
vue(),
pwa({
registerType: 'autoUpdate',
mode: process.env.NODE_ENV,
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,md}'],
},
// devOptions: { enabled: true },
includeAssets: ['favicon.svg'],
manifest: {
name: 'Hades Space',
short_name: 'HadesSpace',
description: 'Current information about the game Hades\' star',
theme_color: '#161b1d',
background_color: '#000000',
icons: [
{ 'src': 'favicon/32x32.png', 'sizes': '32x32', 'type': 'image/png' },
{ 'src': 'favicon/16x16.png', 'sizes': '16x16', 'type': 'image/png' },
{ 'src': 'favicon/512x512.png', 'sizes': '512x512', 'type': 'image/png' },
{ 'src': 'favicon/192x192.png', 'sizes': '192x192', 'type': 'image/png' },
{ 'src': 'favicon/512x512.png', 'sizes': '512x512', 'type': 'image/png', 'purpose': 'maskable' },
{ 'src': 'favicon/192x192.png', 'sizes': '192x192', 'type': 'image/png', 'purpose': 'maskable' },
],
},
}),
],
});