-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssr.config.js
35 lines (34 loc) · 897 Bytes
/
ssr.config.js
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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import laravel from "laravel-vite-plugin";
import path from 'path';
export default defineConfig({
plugins: [
laravel({
input: ["resources/js/app.jsx", "resources/css/app.css"],
ssr: "resources/js/ssr.jsx", // Enable SSR
publicDirectory: "public",
buildDirectory: "bootstrap",
refresh: true,
}),
react(),
],
build: {
ssr: true, // Enable SSR
outDir: "bootstrap",
rollupOptions: {
input: "resources/js/ssr.jsx",
output: {
entryFileNames: "assets/[name].js",
chunkFileNames: "assets/[name].js",
assetFileNames: "assets/[name][extname]",
manualChunks: undefined, // Disable automatic chunk splitting
},
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./resources/js"),
},
},
});