forked from EKKOLearnAI/hermes-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.website.ts
More file actions
54 lines (53 loc) · 1.34 KB
/
Copy pathvite.config.website.ts
File metadata and controls
54 lines (53 loc) · 1.34 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import pkg from './package.json'
export default defineConfig({
root: 'packages/website',
plugins: [vue()],
define: {
__APP_VERSION__: JSON.stringify(pkg.version),
},
resolve: {
alias: {
'@': resolve(__dirname, 'packages/website/src'),
'@client': resolve(__dirname, 'packages/client/src'),
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "@/styles/variables" as *;\n`,
},
},
},
build: {
outDir: '../../dist/website',
emptyOutDir: true,
minify: 'esbuild',
sourcemap: false,
target: 'es2020',
cssCodeSplit: true,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('vue') || id.includes('vue-router') || id.includes('vue-i18n') || id.includes('pinia')) {
return 'vue-vendor'
}
if (id.includes('naive-ui')) {
return 'ui-vendor'
}
return 'vendor'
}
},
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js',
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
},
},
},
server: {
port: 3000,
},
})