mirror of
https://github.com/diced/zipline.git
synced 2025-12-05 20:40:12 -08:00
* feat: start removing next.js * feat: working ssr + dev + prod env * feat: all functionality added + client/ -> src/client/ * fix: build process * fix: caching on pnpm action * fix: ignores + cache action * fix: docker + exdev error * fix: generate prisma before types * fix: remove node@20 from actions * feat: dynamic import optimizations + titled pages * fix: removed unused vars * feat: small ui fixes and improvements * feat: small ui improvements * fix: linting error * fix: regex when adding domains
53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
// @ts-ignore
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
import { defineConfig } from 'vite';
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
if (mode === 'development')
|
|
return {
|
|
plugins: [react()],
|
|
root: './src/client',
|
|
build: {
|
|
outDir: '../../build/client',
|
|
},
|
|
server: {
|
|
middlewareMode: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
};
|
|
|
|
return {
|
|
plugins: [react()],
|
|
root: './src/client',
|
|
build: {
|
|
outDir: '../../build/client',
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
input: {
|
|
main: path.resolve(__dirname, 'src/client/index.html'),
|
|
'ssr-view': path.resolve(__dirname, 'src/client/ssr-view/index.html'),
|
|
'ssr-view-url': path.resolve(__dirname, 'src/client/ssr-view-url/index.html'),
|
|
},
|
|
...(mode.startsWith('ssr') && {
|
|
output: {
|
|
entryFileNames: mode + '.js',
|
|
format: 'cjs',
|
|
},
|
|
plugins: [],
|
|
}),
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
};
|
|
});
|