goez/laravel-grunt

This package is abandoned and no longer maintained. No replacement package was suggested.

Asset manager for Laravel 4 using the power of Grunt.

dev-master 2018-11-02 04:10 UTC

README

This package isn't stable for production. Testing and bug reporting are welcome.

Features

Installation

  1. Add the following line to your composer.json "require-dev" array:

    "goez/laravel-grunt": "dev-master"

  2. Run composer update --dev in your terminal.

  3. Add the following line to the end of you app/config.php "providers array":

    'Goez\LaravelGrunt\LaravelGruntServiceProvider',

  4. Run the following command to add the configuration file to your app/config/packages directory:

    php artisan grunt:config

  5. You can configure the path of assets, and published files. This configuration file is located in your project's config directory, as below:

    • app/config/packages/goez/laravel-grunt/config.php
    • app/config/packages/goez/laravel-grunt/local/config.php
  6. Finally, run the following command to generate all metadata files and install packages in your app:

    php artisan grunt:setup

Note 1: You can edit the package.json, bower.json, Grunfile.js directly after they are generated.

Note 2: You must rerun grunt:config and grunt:setup after you update this package with composer.

Commands

You can use bower and grunt command to manage your assets.

  • bower to list all commands of Bower.
  • grunt --help to list all commands of Grunt.

Assets in view template

You can use the 'grunt_asset' helper to get asset url. Here are examples on blade template:

<link rel="stylesheet" href="{{ grunt_asset('styles/hello.css') }}"/>
<script src="{{ grunt_asset('styles/hello.css') }}"></script>

or:

{{ HTML::style(grunt_asset('scripts/hello.js')) }}
{{ HTML::script(grunt_asset('scripts/hello.js')) }}

Bugs Report

Please report the bugs that you found to Issus page of this package.

Contributors

Original Contributors

This package is base on JasonMortonNZ / laravel-grunt.

Thanks to: