-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
40 lines (38 loc) · 1.2 KB
/
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
39
40
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
// depending on your application, base can also be "/"
// base: '/',
plugins: [react(), viteTsconfigPaths()],
define: {
'process.env.REACT_APP_GRAPHQL_HTTP_URI': JSON.stringify(env.REACT_APP_GRAPHQL_HTTP_URI),
'process.env.REACT_APP_GRAPHQL_WS_URI': JSON.stringify(env.REACT_APP_GRAPHQL_WS_URI),
},
resolve: {
alias: [
// { find: '', replacement: path.resolve(__dirname, 'src') },
// {
// find: /^~(.+)/,
// replacement: path.join(process.cwd(), 'node_modules/$1')
// },
// {
// find: /^src(.+)/,
// replacement: path.join(process.cwd(), 'src/$1')
// }
// {
// find: 'assets',
// replacement: path.join(process.cwd(), 'src/assets')
// },
],
},
server: {
// this ensures that the browser opens upon server start
open: true,
// this sets a default port to 3000
port: 4200,
},
};
});