mirror of
https://github.com/diced/zipline.git
synced 2025-12-12 07:40:45 -08:00
feat: remove next.js in favor of client-side only (#857)
* 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
This commit is contained in:
52
vite.config.ts
Normal file
52
vite.config.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
// @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'),
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user