mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 01:54:43 +03:00
34 lines
797 B
TypeScript
34 lines
797 B
TypeScript
|
import { defineConfig } from 'vite';
|
||
|
import analyze from 'rollup-plugin-analyzer';
|
||
|
import { visualizer } from 'rollup-plugin-visualizer';
|
||
|
import reactRefresh from '@vitejs/plugin-react-refresh';
|
||
|
|
||
|
// https://vitejs.dev/config/
|
||
|
export default defineConfig(({ mode }) => ({
|
||
|
base: mode === 'mock' ? undefined : '/apps/grid/',
|
||
|
server:
|
||
|
mode === 'mock'
|
||
|
? undefined
|
||
|
: {
|
||
|
proxy: {
|
||
|
'^((?!/apps/grid).)*$': {
|
||
|
target: 'http://localhost:8080'
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
build:
|
||
|
mode !== 'profile'
|
||
|
? undefined
|
||
|
: {
|
||
|
rollupOptions: {
|
||
|
plugins: [
|
||
|
analyze({
|
||
|
limit: 20
|
||
|
}),
|
||
|
visualizer()
|
||
|
]
|
||
|
}
|
||
|
},
|
||
|
plugins: [reactRefresh()]
|
||
|
}));
|