-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
27 lines (24 loc) · 751 Bytes
/
Copy pathvite.config.js
File metadata and controls
27 lines (24 loc) · 751 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
// https://vitejs.dev/config/
const appName = process.env.APP || 'portfolio-state-machine';
export default defineConfig({
root: resolve(__dirname, `apps/${appName}`),
// Use relative asset paths so the site works from any base URL
base:
process.env.NODE_ENV === 'production'
? './'
: '/',
build: {
outDir: resolve(__dirname, `docs/apps/${appName}`),
},
plugins: [react()],
test: {
globals: true,
setupFiles: resolve(__dirname, 'src/common/setupTests.js'),
environment: 'jsdom',
},
})