You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
This is the stack I'm using React.js, Inertia, Laravel
I'm trying to split my application into two parts.
There are pages that everyone can view and also routes (starts with /admin) that only a few authorized users can view.
I don't want everyone to download the unnecessary pages, that they can't even access.
But that's not what I exactly want.
I mean code splitting will split all the pages in multiple bundles, but I don't want that.
I only want to split it into two parts.
Here's my current config
// app.jsimportReactfrom'react';import{render}from'react-dom';import{createInertiaApp}from'@inertiajs/inertia-react';import{InertiaProgress}from'@inertiajs/progress';constappName=window.document.getElementsByTagName('title')[0]?.innerText||'Laravel';createInertiaApp({title: title=>`${title} - ${appName}`,resolve: name=>require(`./Pages/${name}`),setup({ el, App, props }){returnrender(<App{...props}/>,el);},});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
This is the stack I'm using
React.js
,Inertia
,Laravel
I'm trying to split my application into two parts.
There are pages that everyone can view and also routes (starts with
/admin
) that only a few authorized users can view.I don't want everyone to download the unnecessary pages, that they can't even access.
What would be the best way to achieve this?
I tried Code Splitting.
But that's not what I exactly want.
I mean code splitting will split all the pages in multiple bundles, but I don't want that.
I only want to split it into two parts.
Here's my current config
Thank you so much for reading :)
Beta Was this translation helpful? Give feedback.
All reactions