-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
44 lines (42 loc) · 1.26 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
import path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
import markdown from 'vite-plugin-markdown';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
svgr({ include: '**/*.svg' }),
react(),
markdown.plugin({ mode: markdown.Mode.HTML }),
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'service-worker.ts',
registerType: 'autoUpdate'
})
],
resolve: {
alias: {
'@components': path.resolve(__dirname, '/src/components'),
'@hooks': path.resolve(__dirname, '/src/hooks'),
'@utilities': path.resolve(__dirname, '/src/utilities'),
'@customTypes': path.resolve(__dirname, '/src/customTypes')
}
},
esbuild: {
logOverride: { 'this-is-undefined-in-esm': 'silent' }
},
define: {
__VERSION__: `"${process.env.npm_package_version}"`,
__SERVER_URL__: `"${
process.env.NODE_ENV === 'production'
? 'https://betterdo.app'
: 'http://localhost:8000'
}"`
},
base: './',
server: {
port: 8080
}
});