forked from linera-io/linera-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
51 lines (48 loc) · 1015 Bytes
/
vite.config.ts
File metadata and controls
51 lines (48 loc) · 1015 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
45
46
47
48
49
50
51
import { defineConfig } from 'vite';
import path from 'path';
const checkEnvironment = envs => {
const missing = envs.filter(env => !(env in process.env));
if (missing.length > 0)
throw new Error(`required environment variables missing: ${missing.toString()}`);
return {
name: 'checkEnvironment',
};
}
// https://vitejs.dev/config/
export default defineConfig({
base: '',
envPrefix: 'LINERA_',
plugins: [
checkEnvironment([
'LINERA_FAUCET_URL',
'LINERA_APPLICATION_ID',
]),
],
server: {
headers: {
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin',
},
fs: {
allow: [
path.resolve(__dirname, '.'),
path.resolve(__dirname, '../web'),
],
},
},
build: {
rollupOptions: {
external: ['@linera/client'],
},
},
esbuild: {
supported: {
'top-level-await': true,
},
},
optimizeDeps: {
exclude: [
'@linera/client',
],
},
})