Giter VIP home page Giter VIP logo

gulp-rev-versions-bundle's Introduction

GulpRevVersionsBundle

Build Status SensioLabsInsight

This bundle helps you using your assets versioned with gulp-rev in a symfony project by making the twig function asset return the files mapped in your gulp-rev manifest.

Installation

Step 1. Download with composer

composer require irozgar/gulp-rev-versions-bundle

Step 2. Add the bundle to AppKernel

<?php
// app/AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Irozgar\GulpRevVersionsBundle\IrozgarGulpRevVersionsBundle(),
        );
    }
}

Step 3. Configure your bundle

The configuration of the bundle depends on the symfony version

Symfony version < 3.1

Now you have to make the bundle replace the default version strategy for your assets. To make this add the following to your config.yml file:

# app/config/config.yml

irozgar_gulp_rev_versions:
    replace_default_version_strategy: ~
    
    # This section is needed only if you use symfony packages
    # packages in this list will use the version strategy
    packages:
        - one_package
        - another_package

Symfony version = 3.1

This symfony version introduced a new option to configure the version strategy.

Add this to your config.yml to tell symfony what version strategy it should use

# app/config/config.yml

framework:
    # ...
    assets:
        version_strategy: irozgar_gulp_rev_versions.asset.gulp_rev_version_strategy
       
# ...

# This is only needed if using a custom path for the manifest file
irozgar_gulp_rev_versions:
    manifest_path: "your/custom/path/rev-manifest.json"

Configuring the manifest file path

The default location of the rev-manifest.json file is app/Resources/assets/rev-manifest.json. You can customize it by adding the following lines to your config.yml

# app/config/config.yml

irozgar_gulp_rev_versions:
    manifest_path: "your/custom/path/rev-manifest.json"

NOTE All paths will be relative to %kernel.root_dir%

gulp-rev-versions-bundle's People

Contributors

azzra avatar derekroth avatar irozgar avatar quentin-st avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.