-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
57 lines (54 loc) · 1.41 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
45
46
47
48
49
50
51
52
53
54
55
56
57
import { defineConfig, loadEnv } from 'vite';
import solidPlugin from 'vite-plugin-solid';
import { urbitPlugin } from '@urbit/vite-plugin-urbit';
import path from 'path';
// export default defineConfig({
// plugins: [solidPlugin()],
// server: {
// port: 3000,
// },
// build: {
// target: 'esnext',
// },
// });
// https://vitejs.dev/config/
export default ({ mode }) => {
Object.assign(process.env, loadEnv(mode, process.cwd(), ''));
const SHIP_URL = process.env.SHIP_URL || process.env.VITE_SHIP_URL ||
'http://localhost:8080';
console.log(SHIP_URL);
return defineConfig({
plugins: [
urbitPlugin({ base: 'turf', target: SHIP_URL, secure: false }),
solidPlugin(),
],
base: '/apps/turf/',
resolve: {
alias: {
'~': path.resolve('./src'),
'@': path.resolve('./src/components'),
lib: path.resolve('./src/lib'),
css: path.resolve('./src/css'),
stores: path.resolve('./src/stores'),
assets: path.resolve('./src/assets'),
vendor: path.resolve('./src/vendor'),
},
},
define: {
'process.env.prod': !process.env.NODE_ENV === 'development',
'process.env.meteredApiKey': '"' + process.env.METERED_API_KEY + '"',
},
server: {
port: 3000,
fs: {
strict: false,
},
hmr: {
overlay: false,
},
},
build: {
target: 'esnext',
},
});
};