EducaPerú’s asset pipeline is powered by Vite with the official Laravel plugin. Vite compiles the CSS and JavaScript entry points inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AlexQuintana147/EducaPeru/llms.txt
Use this file to discover all available pages before exploring further.
resources/ and outputs versioned files to public/build/. Tailwind CSS is installed locally via the @tailwindcss/vite plugin and imported directly in resources/css/app.css — static files (images, videos, fonts, and PDFs) are served straight from the public/ directory without any compilation step.
Vite Configuration
The project’svite.config.js registers both the Laravel plugin and the @tailwindcss/vite plugin, configures the CSS and JS entry points, enables Hot Module Replacement during development, and excludes compiled view files from the file watcher:
vite.config.js
CSS Entry Point
resources/css/app.css imports Tailwind via the @tailwindcss package, declares explicit @source paths so Tailwind scans all Blade templates and JS files for class names, and sets a custom --font-sans theme token:
resources/css/app.css
JavaScript Entry Point
resources/js/app.js is minimal — it imports bootstrap.js, which configures Axios with the X-Requested-With header required for Laravel to recognise AJAX requests:
resources/js/app.js
resources/js/bootstrap.js
Build Commands
npm run build compiles and versions the assets into public/build/ and generates a manifest.json used by the @vite Blade directive. Running npm run dev starts the Vite dev server with Hot Module Replacement so changes to CSS and JS files are reflected in the browser instantly without a full page reload.
Public Directory Structure
Static assets are organised into purpose-specific subdirectories underpublic/:
Referencing Assets in Blade
Use Laravel’sasset() helper to generate correct absolute URLs to any file under public/. This ensures links remain valid regardless of the application’s base URL or subdirectory configuration:
The master layout (
layouts/app.blade.php) also loads Tailwind via the cdn.tailwindcss.com script tag alongside the compiled app.css. During a future production hardening pass, the CDN <script> tag can be removed once the compiled stylesheet is confirmed to cover all utility classes in use — removing it will eliminate the extra network round-trip and enable full dead-code elimination through Vite’s build step.