One Vite configuration at the project root builds the admin and Echo themes and the bundled modules. A distributed site ships with public/build already built, so an installed plugin must bring its assets with it rather than rely on a rebuild.
| Command | Does |
|---|---|
npm install | Install the build tools and front-end libraries |
npm run build | Production build into public/build with manifest.json, and copy theme and module images into public/themes and public/modules |
npm run dev | Dev server with hot reload; writes public/hot while it runs |
npm run templates:kit | Compile the ui-* section kit to resources/themes/echo/page-templates/kit.css; reseed the template library to store it |
composer format:html | Prettier on template-library HTML (Echo and module page-templates) |
Every entry is listed in the input array of vite.config.js. Nothing is discovered automatically.
| Group | Entries |
|---|---|
| Echo | assets/sass/app.scss, assets/sass/app-editor.scss, assets/js/app.js |
| Admin | assets/sass/app.scss, translation UI styles, GrapesJS styles, assets/js/app.js, assets/js/page-builder.js |
| Template library | page-templates/scripts/motion.js, widgets.js (loaded only by pages whose sections need them) |
| Booking, TruCommerce, TruPayments | Their admin and front Sass and JavaScript under Modules/{Name}/resources |
Static images are copied by vite-plugin-static-copy: theme images to public/themes/{admin,echo,default}, module images to public/modules/booking and public/modules/tru-commerce, and the CKEditor build to public/themes/default/js. The JavaScript alias @ points to resources/themes/default/assets/js.
php artisan optimize:clear on a site whose views are compiled by dotartisan:optimize.If a page fails with Unable to locate file in Vite manifest, the entry it asks for was never built: add it to input and run npm run build, or stop npm run dev if public/hot points to a server that is no longer running.
Choose by how the plugin is distributed:
| Approach | How | Use when |
|---|---|---|
| Pre-built static files | Build your CSS and JS yourself, put the output in resources/assets, run php artisan module:publish Testimonials on install, and link with asset('modules/testimonials/app.css') | Plugins installed from a ZIP. This works on any site without Node |
| Shortcode assets | Declare them on the definition: ->assets(['styles' => [...], 'scripts' => [...]]); they load only on pages that contain the block | Page-builder blocks |
| Inline in Blade | @push('page_header') for small styles, @push('page_scripts') for small scripts | A few lines |
| Vite entry | Add your files to input in the root vite.config.js, build, then @vite('Modules/Testimonials/resources/js/app.js') | Plugins developed inside a site's repository, where you control the build |
var(--bs-primary), var(--bs-body-color), color-mix(in srgb, var(--bs-primary) 12%, transparent)). Hard-coded colours break custom and dark palettes..testimonials-…).margin-inline-start) so right-to-left languages work.Admin pages push their assets into the admin layout:
<x-admin-layout>
@push('page_header')
<link rel="stylesheet" href="{{ asset('modules/testimonials/admin.css') }}">
@endpush
{{-- page content --}}
@push('page_scripts')
<script src="{{ asset('modules/testimonials/admin.js') }}" defer></script>
@endpush
</x-admin-layout>public/build/* and public/hot — build output.storage/app/public/css/themes/*/app.css — compiled theme CSS.resources/themes/echo/page-templates/kit.css — generated by npm run templates:kit.public/themes/*, public/modules/* — copied from resources by the build or by module:publish.