-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
44 lines (41 loc) · 1.29 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
41
42
43
44
import { defineConfig, loadEnv } from 'vite';
import path from 'path';
export default defineConfig(({ command, mode }) => {
// Load env file based on `mode` in the current working directory.
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
const env = loadEnv(mode, process.cwd(), ''); // https://main.vitejs.dev/config/#using-environment-variables-in-config
return {
define: {
__APP_ENV__: JSON.stringify(env.APP_ENV),
},
base: command === 'serve' ? '' : '/dist/',
publicDir: './public',
build: {
manifest: true,
outDir: './public/dist/',
rollupOptions: {
input: {
app: './src/app/app.ts',
css: './src/styles/main.scss',
},
output: {
sourcemap: true
},
},
},
server: {
fs: {
strict: false,
},
origin: env.PRIMARY_SITE_URL || 'http://localhost:3000',
host: '0.0.0.0',
port: 3000,
strictPort: true,
},
resolve: {
alias: {
'@': path.resolve(__dirname, './'),
},
},
};
});