Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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.

  1. Confirm compatibility. Check 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.
  2. Install and inspect.
    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.
  3. Publish the import template and config early. The v0.5.1 notes explicitly say the author now has more "control to manipulate the import template", so the template is the surface you are most likely to want to override — and the one most likely to drift:
    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.
  4. First use case: wire one layout — a single CSS import and a single JS import — render it, and confirm the emitted markup, ordering, and dedupe. Don't start by restructuring your asset pipeline; start by proving you understand what one import produces.

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.

Implementation Patterns

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.

Gotchas and Tips

  • Pin the exact version. "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.
  • The changelog compare link is 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.
  • Template drift is now the primary upgrade risk. The author states the import template is easier for them to manipulate. That's good for them, bad for your published override. Diff your copy against the vendor template on every upgrade; expect changes.
  • Don't patch vendor code. If you need different output, publish the template or override in a subclass; if you need a composer patch, the package isn't a fit.
  • Compiled/cached views mask changes. After publishing or editing the template, run php artisan view:clear; after config changes, php artisan config:clear. A stale compiled view makes it look like the package ignored your override.
  • Autoloading is the usual "class not found" cause. Any namespace change or new published class → composer dump-autoload.
  • Namespace collisions. Gwleuverink\Bundle and generic names like Bundle / Concerns invite clashes with your own code. Alias imports explicitly.
  • Debugging approach. Render the component in 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.
  • Extension points, in order of preference: published config → published import template → your own wrapper component. Subclassing internals is a last resort given the churn rate.
  • Watch the CSS loader specifically after every upgrade. It has already regressed once; add the dev-and-build check to your upgrade checklist.
  • Bus factor / exit plan. The package is a thin layer over Blade plus asset tags. Keep it that way: if removing it means rewriting your layouts rather than swapping one render call, you've coupled too tightly.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle