From 1aff175819230a06fd02c97b198d8c2dbaf0d791 Mon Sep 17 00:00:00 2001 From: rahmatrafli1 Date: Tue, 17 Mar 2026 19:11:37 +0700 Subject: [PATCH] Add initial app structure with Inertia.js integration --- resources/js/app.jsx | 21 +++++++++++++++++++++ resources/views/app.blade.php | 14 ++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 resources/js/app.jsx create mode 100644 resources/views/app.blade.php diff --git a/resources/js/app.jsx b/resources/js/app.jsx new file mode 100644 index 0000000..012cf45 --- /dev/null +++ b/resources/js/app.jsx @@ -0,0 +1,21 @@ +import "./bootstrap"; +import "../css/app.css"; +import { createRoot } from "react-dom/client"; +import { createInertiaApp } from "@inertiajs/react"; +import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers"; + +createInertiaApp({ + title: (title) => `${title} - Perpustakaanku`, + resolve: (name) => + resolvePageComponent( + `./Pages/${name}.jsx`, + import.meta.glob("./Pages/**/*.jsx"), + ), + setup({ el, App, props }) { + const root = createRoot(el); + root.render(); + }, + progress: { + color: "#4F46E5", + }, +}); diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php new file mode 100644 index 0000000..e6fcdd6 --- /dev/null +++ b/resources/views/app.blade.php @@ -0,0 +1,14 @@ + + + + + + Perpustakaanku + @viteReactRefresh + @vite(['resources/css/app.css', 'resources/js/app.jsx']) + @inertiaHead + + + @inertia + +