Serve the showcase's own stylesheet without the application's build
Plan step 38 (first batch): a route bundles all.css, showcase.css and the application's generated scheme (Stylesheets::bundle(), found next to its configured JSON by swapping the extension, or a Scheme::load() fallback in tokens/scheme.css's own shape) into one long-cached, content-hashed CSS response; a stale hash redirects to the current one. A second route serves the fonts and SVGs its relative url()s point at, from the package's fonts/ and svg/ folders only, MIME-typed by extension and 404ing on ".." or an unlisted extension. Both stay unregistered with the showcase off. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
bce55b26a2
commit
1c8a4d412a
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use NoNameWeb\LivewireMaterial\Http\Controllers\ShowcaseAssetController;
|
||||
use NoNameWeb\LivewireMaterial\Http\Controllers\ShowcaseController;
|
||||
use NoNameWeb\LivewireMaterial\Http\Controllers\ShowcasePageController;
|
||||
use NoNameWeb\LivewireMaterial\Http\Controllers\ShowcaseSymbolController;
|
||||
@@ -11,6 +12,15 @@ Route::get('/', [ShowcaseController::class, 'index'])->name('showcase');
|
||||
Route::get('symbols.json', [ShowcaseSymbolController::class, 'index'])->name('symbols');
|
||||
Route::get('symbols/{style}/{name}.svg', [ShowcaseSymbolController::class, 'show'])->name('symbol');
|
||||
|
||||
// The showcase's own bundle (all.css, showcase.css, the application's scheme), long-cached under
|
||||
// the hash of its own content, and the two package folders its relative url()s may point into.
|
||||
Route::get('showcase.{hash}.css', [ShowcaseAssetController::class, 'stylesheet'])
|
||||
->where('hash', '[0-9a-f]+')
|
||||
->name('stylesheet');
|
||||
Route::get('assets/{path}', [ShowcaseAssetController::class, 'file'])
|
||||
->where('path', '.*')
|
||||
->name('asset');
|
||||
|
||||
Route::view('shell/{page?}', 'livewire-material::showcase.shell')
|
||||
->whereIn('page', ['inbox', 'starred', 'sent', 'drafts', 'travel', 'receipts'])
|
||||
->name('shell');
|
||||
|
||||
Reference in New Issue
Block a user