-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.ts
52 lines (49 loc) · 1.37 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
import { fileURLToPath, URL } from 'node:url';
import path from 'node:path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import inject from '@rollup/plugin-inject';
import viteBasicSslPlugin from '@vitejs/plugin-basic-ssl';
// import copy from '@rollup-extras/plugin-copy';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
plugins: [
vue(),
viteBasicSslPlugin(),
mode === 'production'
&& inject({
'exclude': 'node_modules/**',
'console.log': path.resolve(__dirname, 'src/shims/console/log.js'),
'console.error': path.resolve(__dirname, 'src/shims/console/error.js'),
'console.warn': path.resolve(__dirname, 'src/shims/console/warn.js'),
}),
],
build: {
sourcemap: true,
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('node_modules')) {
return 'vendor';
}
},
},
},
},
esbuild: {
pure: ['console.debug'],
},
server: {
https: true,
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'~bootstrap': path.resolve(__dirname, 'node_modules/bootstrap'),
// supresses externalized Module warnings
// I think this does something other than intended
// 'source-map-js': 'source-map',
// path: 'path-browserify',
},
},
}));