-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
42 lines (38 loc) · 1015 Bytes
/
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
import tailwindcss from 'tailwindcss'
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import VueRouter from 'unplugin-vue-router/vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import SSL from '@vitejs/plugin-basic-ssl';
const args = process.argv;
const isPages = args.includes('--pages');
const defaultPlugins = [VueRouter(), vue(), nodePolyfills({ protocolImports: true })];
if (process.argv.includes('--dev')) {
defaultPlugins.push(SSL());
}
// https://vitejs.dev/config/
export default defineConfig({
base: isPages ? '/ultra-tool-kit' : '',
plugins: defaultPlugins,
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis',
},
},
},
resolve: {
alias: {
vue: 'vue/dist/vue.esm-bundler.js'
}
},
css: {
postcss: {
plugins: [tailwindcss],
},
},
server: {
port: 5172,
https: false,
}
});