-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
44 lines (42 loc) · 895 Bytes
/
vite.config.js
File metadata and controls
44 lines (42 loc) · 895 Bytes
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 { fileURLToPath, URL } from 'url';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import environment from 'vite-plugin-environment';
import dotenv from 'dotenv';
dotenv.config({ path: '../../.env' });
export default defineConfig({
build: {
emptyOutDir: true,
},
optimizeDeps: {
esbuildOptions: {
define: {
global: "globalThis",
},
},
},
server: {
proxy: {
"/api": {
target: "http://127.0.0.1:4943",
changeOrigin: true,
},
},
},
plugins: [
react(),
environment("all", { prefix: "CANISTER_" }),
environment("all", { prefix: "DFX_" }),
],
resolve: {
alias: [
{
find: "declarations",
replacement: fileURLToPath(
new URL("../declarations", import.meta.url)
),
},
],
dedupe: ['@dfinity/agent'],
},
});