-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
46 lines (44 loc) · 1.07 KB
/
vite.config.js
File metadata and controls
46 lines (44 loc) · 1.07 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
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
resolve: {
alias: {
'/config_terminal': path.resolve(__dirname, process.env.WEBVM_MODE == "github" ? 'config_github_terminal.js' : 'config_public_terminal.js'),
"@leaningtech/cheerpx": process.env.CX_URL ? process.env.CX_URL : "@leaningtech/cheerpx"
}
},
ssr: {
noExternal: [/config_.*\.js$/]
},
build: {
target: "es2022"
},
optimizeDeps: {
esbuildOptions: {
target: "es2022"
}
},
server: {
fs: {
allow: ['.']
}
},
plugins: [
sveltekit(),
viteStaticCopy({
targets: [
{ src: 'tower.ico', dest: '' },
{ src: 'scrollbar.css', dest: '' },
{ src: 'serviceWorker.js', dest: '' },
{ src: 'login.html', dest: '' },
{ src: 'assets/', dest: '' },
{ src: 'documents/', dest: '' },
{ src: 'disk-images/', dest: '' }
]
})
]
});