This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
107 lines (102 loc) · 2.56 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
/* eslint-disable camelcase */
/**
* @fileoverview Vite config
*
* Inspired by https://github.com/antfu/vitesse
*/
//Imports
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import Layouts from 'vite-plugin-vue-layouts';
import Licenses from './plugins/licenses';
import Metadata from './plugins/metadata';
import Pages from 'vite-plugin-pages';
import Paths from 'vite-tsconfig-paths';
import Portals from './plugins/portals';
import Vue from '@vitejs/plugin-vue';
import Yaml from '@rollup/plugin-yaml';
import loadPlugins from './lib/plugin';
import {VitePWA} from 'vite-plugin-pwa';
import {Vuetify3Resolver} from 'unplugin-vue-components/resolvers';
import {defineConfig, UserConfig} from 'vite';
import {dirname, join} from 'path';
import {fileURLToPath} from 'url';
//Export
export default defineConfig(async env =>
{
//Get the directory name
const dir = dirname(fileURLToPath(import.meta.url));
//Define the initial config
let config = {
root: join(dir, '.merged'),
plugins: [
Licenses({
root: join(dir, '..', '..')
}),
Metadata(),
Paths({
projects: [
join(dir, 'tsconfig.json')
]
}),
Vue(),
Pages(),
Layouts(),
Portals(),
AutoImport({
imports: [
'@vueuse/core',
'@vueuse/head',
'pinia',
'vee-validate',
'vue',
'vue-i18n',
'vue-router',
{
'~/ui/composables/wormhole': [
'useBlackHole',
'useWhiteHole'
]
}
]
}),
Components({
resolvers: [
Vuetify3Resolver()
]
}),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'Cloud CNC',
short_name: 'Cloud CNC',
description: 'Scalable CNC machine orchestration',
theme_color: '#2196f3',
background_color: '#191919',
icons: [
{
src: '/android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: '/android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png'
}
]
}
}),
Yaml()
],
test: {
include: [
join(dir, 'src', '{components,layouts,pages}', '**', '*.spec.ts')
],
testTimeout: 15000
}
} as UserConfig;
//Load plugins
config = await loadPlugins(dir, config, env);
return config;
});