-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
62 lines (57 loc) · 1.18 KB
/
vite.config.js
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
61
62
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path';
import copy from 'rollup-plugin-copy'
import WindiCSS from 'vite-plugin-windicss'
const commitHash = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString()
.trim();
function pathResolve(dir) {
return resolve(process.cwd(), '.', dir);
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
WindiCSS(),
copy({
targets: [
{
src: 'node_modules/onnxruntime-web/dist/*.wasm',
dest: 'public',
},
],
hook: 'buildStart'
})
],
define: {
__COMMIT_HASH__: JSON.stringify(commitHash),
},
resolve:{
alias:[
{
find: '@',
replacement: pathResolve('src') + '/',
},
{
find:"compassql",
replacement: resolve("node_modules/compassql/build/compassql.js")
}
]
},
build:{
// sourcemap:true,
// minify:false
},
server:{
proxy:{
'/api':{
target:'http://localhost:5001',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
},
cors:true,
}
})