-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (55 loc) · 1.47 KB
/
vite.config.ts
File metadata and controls
60 lines (55 loc) · 1.47 KB
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
53
54
55
56
57
58
59
60
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import vueDevTools from 'vite-plugin-vue-devtools'
import Inspect from 'vite-plugin-inspect'
const dev = 'dev'
export default defineConfig(({ command: _command }) => {
// // Determine base path for GitHub Pages
// const isProduction = mode === 'production'
// const isGitHubPages = isProduction && process.env.GITHUB_ACTIONS === 'true'
// For GitHub Pages, use repository name as base path
// const base = isGitHubPages ? '/involvex/' : '/'
return {
base: './',
server: {
port: 8098,
host: '0.0.0.0',
allowedHosts: ['*'],
},
plugins: [
vue(),
vueJsx(),
vueDevTools(),
Inspect({
build: true,
outputDir: '.vite-inspect',
}),
],
envPrefix: ['VITE_'],
build: {
sourcemap: dev ? 'inline' : false,
assetsDir: 'assets',
copyPublicDir: true,
polyfillModulePreload: false,
modulePreload: false,
rollupOptions: {
output: {
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`,
},
input: {
main: 'index.html',
404: 'public/404.html',
},
}
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
}
})