Inertia的安装过程分为两个主要阶段: 服务器端(Laravel)和客户端(VueJs). Inertia文档中的官方安装指南有点过时了,因为Laravel 9现在默认使用Vite,但我们也会去看看。 1. Server-Side 我们需要做的第一件事是通过Composer用以下终端命令安装Inertia服务器端适配器。 composer require inertiajs/inertia-laravel 现在我...
importlaravelfrom'laravel-vite-plugin'; exportdefaultdefineConfig({ plugins:[ laravel([ 'resources/css/app.css', 'resources/js/app.js', ]), ], }); 如果您正在构建 SPA,包括使用 Inertia 构建的应用程序,则 Vite 在没有 CSS 入口点的情况下运行最佳: ...
Remove dist from inertia-helpers import May 25, 2022 .styleci.yml Create .styleci.yml May 20, 2022 CHANGELOG.md Update CHANGELOG Dec 3, 2024 LICENSE.md Create initial plugin May 2, 2022 README.md Remove second vite link Jul 3, 2022 ...
安装Vite 和 Laravel Plugin 配置Vite 加载Scripts 和 Styles 运行Vite 处理JavaScript 别名 Vue React Inertia URL 处理 处理Stylesheets 自定义 Base URLs 环境变量 服务端渲染 (SSR) 介绍 Vite是一个现代的前端构建工具,它提供一个非常快速的开发环境,并将您的代码打包用于生产。使用 Laravel 构建应用程序时,您通常...
vue3';import{resolvePageComponent}from'laravel-vite-plugin/inertia-helpers';createInertiaApp({resolve:(name)=>resolvePageComponent(`./Pages/${name}.vue`,import.meta.glob('./Pages/**/*.vue')),setup({el,App,props,plugin}){createApp({render:()=>h(App,props)}).use(plugin).mount(el)}...
如果你正在构建一个单页应用程序,包括使用 Inertia 构建的应用程序,则最好不要使用 CSS 入口点: import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ plugins: [ laravel([ 'resources/css/app.css', // [tl! remove] 'resources/js/app.js'...
+import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';createInertiaApp({ title: (title) => `${title} - ${appName}`,-resolve: (name) => require(`./Pages/${name}.vue`),+resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pa...
If you are building an SPA, including applications built using Inertia, Vite works best without CSS entry points:import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ plugins: [ laravel([ 'resources/css/app.css', 'resources/js/app....
If you are building an SPA, including applications built using Inertia, Vite works best without CSS entry points:import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; export default defineConfig({ plugins: [ laravel([ 'resources/css/app.css', // [tl! remove] '...
If you are building an SPA, including applications built using Inertia, Vite works best without CSS entry points:import { defineConfig } from 'vite';import laravel from 'laravel-vite-plugin';export default defineConfig({ plugins: [ laravel([ 'resources/css/app.css', // [tl! remove] '...