forked from simonwep/ocular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
38 lines (37 loc) · 897 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
import { execSync } from 'child_process';
import vue from '@vitejs/plugin-vue';
import { defineConfig } from 'vite';
import { optimizeCssModules } from 'vite-plugin-optimize-css-modules';
import { VitePWA } from 'vite-plugin-pwa';
import tsconfigPaths from 'vite-tsconfig-paths';
import manifest from './assets/manifest.json';
export default defineConfig({
envPrefix: ['OCULAR'],
server: {
port: 3000,
proxy: {
'/api': {
target: 'http://localhost:8080',
rewrite: (path) => path.slice(4) // cut off `/api`
}
}
},
define: {
'import.meta.env.OCULAR_BUILD_TIMESTAMP': Date.now()
},
plugins: [
tsconfigPaths({ loose: true }),
optimizeCssModules(),
vue({
script: {
defineModel: true
}
}),
VitePWA({
manifest,
workbox: {
globPatterns: ['**/*.{js,css,html,woff2}']
}
})
]
});