forked from bcgov/bcrs-shared-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
42 lines (41 loc) · 1.63 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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue2'
import EnvironmentPlugin from 'vite-plugin-environment'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
EnvironmentPlugin({ BUILD: 'web' }) // fix for Vuelidate
],
resolve: {
alias: {
// to find local components in src/
'@/': new URL('./src/', import.meta.url).pathname,
// to find shared components in src/xxx
'@bcrs-shared-components/corp-type-module': new URL('./src/modules/corp-type-module', import.meta.url).pathname,
'@bcrs-shared-components/enums': new URL('./src/enums', import.meta.url).pathname,
'@bcrs-shared-components/interfaces': new URL('./src/interfaces', import.meta.url).pathname,
'@bcrs-shared-components/mixins': new URL('./src/mixins', import.meta.url).pathname,
'@bcrs-shared-components/types': new URL('./src/types', import.meta.url).pathname,
'@bcrs-shared-components/services': new URL('./src/services', import.meta.url).pathname,
'@bcrs-shared-components/': new URL('./src/components/', import.meta.url).pathname
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
},
test: {
// simulate DOM with jsdom
environment: 'jsdom',
// enable jest-like global test APIs
globals: true,
setupFiles: ['./tests/setup.ts'],
// disable threads on GH actions to speed it up
threads: !process.env.GITHUB_ACTIONS,
// hide Vue Devtools message
onConsoleLog: function (log) {
if (log.includes('Download the Vue Devtools extension')) {
return false
}
}
}
})