leuverink/bundle
Bundle is a Laravel package that swaps Vite for Bun's fast bundler, offering familiar Blade directives, hot module reloading, and simple asset compilation so you can build and serve JavaScript and CSS in development and production with minimal configuration.
The release notes for v0.5.1 are a useful correction to first impressions: this package is about managing imports (JS/CSS) and rendering them in the right context — it has an "import template", an "import context", and a CSS loader. It is not a feature-slice/module organizer. Read src/ before you read anything else, and specifically find the import component and its template.
composer.json for supported PHP/Laravel versions. The package is pre-1.0, has ~53 stars and zero dependents, so nothing will warn you about a mismatch.composer require gwleuverink/bundle
Then open vendor/gwleuverink/bundle/src/ and vendor/gwleuverink/bundle/tests/. The tests are the behavioral spec — especially for how imports are deduplicated, grouped, and ordered.php artisan vendor:publish --provider="Gwleuverink\\Bundle\\BundleServiceProvider"
Verify the exact provider FQCN and tags in extra.laravel.providers / the README rather than trusting this snippet.The package's value is a small, declarative layer for "this view/component needs these assets, emit them once, in this order, in the correct context." If your Blade layouts already do that cleanly with @vite/@push, you may not need this.
One place renders imports. Pick a single location in your layout (head for CSS, end of body for JS) that renders the package's import output, and never hand-write <link>/<script> tags elsewhere. Mixing manual tags with managed imports is how you get duplicates and ordering bugs.
Declare imports next to the thing that needs them. The whole point of context-aware imports is that a component/view states its own asset requirements instead of the layout knowing about every feature. Keep declarations in the component that uses the asset, not centralized in a config array.
Rely on context filtering, not manual conditionals. The v0.5.1 refactor removes "code paths not reachable from the current import context" — i.e. the package already produces context-specific output. Don't wrap imports in your own @if($isAdmin)-style guards; that fights the mechanism and duplicates logic.
Publish the template, then own it. If the default markup doesn't match your CSP, nonce, or attribute conventions, publish the import template and customize it in your repo. Do not edit vendor/. Once published, treat the file as your code with the package version recorded next to it.
Ordering and dedupe are the day-to-day wins. Assert both explicitly: include the same import twice from two components and confirm it renders once; declare CSS in one place and JS in another and confirm each lands in the correct region.
CSS loader behavior needs a real check. v0.5.1 contains "fix css loader regression", which means a 0.5.x release shipped with broken CSS handling. Verify CSS imports in both npm run dev and a production build — the loader path differs, and a regression here is silent (styles simply missing).
Testing. Add a smoke test that renders a view using an import and asserts the output HTML: import present, import deduplicated, correct ordering, correct region. That single test catches most upgrade breakage for a package this small.
Integration tip. Keep the integration thin — one layout region, one published template, imports declared in components. If you find yourself building abstractions on top of the package's abstractions, you've made it harder to remove later, which is exactly what a 53-star package shouldn't cost you.
"gwleuverink/bundle": "0.5.1", not ^0.5. Zero dependents means no one else surfaces regressions, and the 0.5.x line already shipped a CSS loader regression that needed a follow-up patch.v0.2.0...v0.5.1. That's a wide gap with intermediate releases you may not have read. If you're upgrading from anything below 0.5, read the individual release notes, not just this one.composer patch, the package isn't a fit.php artisan view:clear; after config changes, php artisan config:clear. A stale compiled view makes it look like the package ignored your override.composer dump-autoload.Gwleuverink\Bundle and generic names like Bundle / Concerns invite clashes with your own code. Alias imports explicitly.php artisan tinker (or a throwaway route) and read the resulting HTML — that's faster than reasoning about the internals. For anything deeper, read the service provider's register()/boot() line by line. With this little documentation, source-reading beats searching.How can I help you explore Laravel packages today?