Wire admin studio SSR and search infrastructure

This commit is contained in:
2026-05-01 11:46:06 +02:00
parent 257b0dbef6
commit 18cea8b0f0
329 changed files with 197465 additions and 2741 deletions

View File

@@ -57,6 +57,7 @@ function shouldIgnoreRollupWarning(warning) {
export default defineConfig({
plugins: [
laravel({
ssr: 'resources/js/ssr.jsx',
input: [
'resources/css/app.css',
'resources/css/nova-grid.css',
@@ -70,10 +71,12 @@ export default defineConfig({
'resources/js/entry-pill-carousel.jsx',
'resources/js/upload.jsx',
'resources/js/studio.jsx',
'resources/js/admin.jsx',
'resources/js/dashboard/index.jsx',
'resources/js/Pages/ArtworkPage.jsx',
'resources/js/artwork.jsx',
'resources/js/Pages/CategoriesPage.jsx',
'resources/js/Pages/Home/HomePage.jsx',
'resources/js/Pages/News/NewsComments.jsx',
'resources/js/Pages/Community/LatestCommentsPage.jsx',
'resources/js/Pages/Community/CommunityActivityPage.jsx',
'resources/js/Pages/Messages/Index.jsx',
@@ -83,7 +86,7 @@ export default defineConfig({
'resources/js/leaderboard.jsx',
'resources/js/settings.jsx',
'resources/js/moderation.jsx',
'resources/js/entry-forum.jsx',
'resources/js/forum.jsx',
'resources/js/render-frame.jsx',
],
refresh: [
@@ -116,7 +119,21 @@ export default defineConfig({
],
},
ssr: {
// Bundle all npm dependencies into the SSR output — the server has no node_modules.
noExternal: true,
},
build: {
// Prevent heavy vendor chunks (tiptap, framer-motion, syntax, realtime) from being
// eagerly preloaded on pages that don't use them (e.g. the homepage). They will still
// load on-demand when the dynamic import actually executes.
modulePreload: {
resolveDependencies: (_filename, deps) => {
const heavyVendors = ['vendor-tiptap', 'vendor-syntax', 'vendor-motion', 'vendor-realtime'];
return deps.filter(dep => !heavyVendors.some(v => dep.includes(v)));
},
},
rollupOptions: {
onwarn(warning, warn) {
if (shouldIgnoreRollupWarning(warning)) {