Weave Code
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

Gulp Buster Bundle Laravel Package

ajaxray/gulp-buster-bundle

View on GitHub
Deep Wiki
Context7

GulpBusterBundle

Build Status Coverage Status Latest Stable Version Total Downloads License SensioLabsInsight

When using gulp to manage assets of a Symfony application, this Bundle will help in cache busting with help of gulp-buster package.

Installation

Install the latest version with

$ composer require ajaxray/gulp-buster-bundle

Then enable the bundle in AppKernel -

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Ajaxray\GulpBusterBundle\GulpBusterBundle(),
    );
}

How to use

Assuming you are using gulp-buster to generate hashes for your web assets (javascript, css, images etc. static resources).

Now the next thing is using those hashes with your web assets. This bundle will make it easy by adding a Twig Filter. Here is how to use this filter in Twig views -

<link rel="stylesheet" href="{{ asset('css/example.min.css')|with_buster_hash  }}">

If a hash is found for this file, it will be appended as query string with it's url -

<link rel="stylesheet" href="/css/example.min.css?v=771191ec8571a3f46afdb78f3e7bed17">

If no hash found for this file -

<link rel="stylesheet" href="/css/example.min.css?v=no-buster-hash-found">

That's all :)

Configuration

By default, this bundle assumes the following paths -

  • busters.json (or any other name) file : %kernel.root_dir%/../busters.json
  • web dir: %kernel.root_dir%/../web
  • gulp dir (the dir of your gulpfile.js): %kernel.root_dir%/..

If any/all of the above is different for you, you can configure from your app/config/config.yml file using following keys -

gulp_buster:  
    # if you've configured it to be in web dir    
    busters_file: "%kernel.root_dir%/../web/busters.json"    
    web_dir: "%kernel.root_dir%/relative/path/to/web/dir"    
    gulp_dir: "%kernel.root_dir%/relative/path/to/dir"    
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.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver