-
Notifications
You must be signed in to change notification settings - Fork 154
/
vite.config.mjs
39 lines (36 loc) · 1.04 KB
/
vite.config.mjs
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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { quasar, transformAssetUrls } from '@quasar/vite-plugin'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import { resolve, dirname } from 'node:path'
import { fileURLToPath } from 'url'
function removeDataTestid (node) {
if (node.type === 1 /* NodeTypes.ELEMENT */) {
node.props = node.props.filter(prop => prop.type === 6 ? prop.name !== 'data-testid' : true)
}
}
const prod = process.env.NODE_ENV === 'production'
export default defineConfig({
base: process.env.VITE_APP_PUBLIC_PATH || '/',
plugins: [
vue({
template: {
transformAssetUrls,
compilerOptions: {
nodeTransforms: prod ? [removeDataTestid] : [],
}
}
}),
quasar(),
VueI18nPlugin({
include: resolve(dirname(fileURLToPath(import.meta.url)), './src/locales/**'),
strictMessage: false
})
],
build: {
sourcemap: true
},
define: {
'__APP_VERSION__': JSON.stringify(process.env.npm_package_version),
}
})