-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
37 lines (34 loc) · 938 Bytes
/
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
import { fileURLToPath, URL } from 'node:url'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import { version } from './package.json'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
// eslint-disable-next-line no-undef
const env = loadEnv(mode, process.cwd(), '')
const url_base = `${env.VITE_URL_BASE ?? '/'}`
const ahorita = new Date()
const fecha_localizada = new Date(ahorita).toLocaleString('es-MX', {
timeZone: 'America/Mexico_City',
})
return {
base: url_base,
define: {
__FECHA_CONSTRUCCION__: JSON.stringify(fecha_localizada),
__VERSION__: JSON.stringify(version),
},
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
}
})