Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/electrotiti/tlassets-bundle
Dump your assets using Gulp on Symfony2 project
https://github.com/electrotiti/tlassets-bundle
Last synced: 24 days ago
JSON representation
Dump your assets using Gulp on Symfony2 project
- Host: GitHub
- URL: https://github.com/electrotiti/tlassets-bundle
- Owner: electrotiti
- License: mit
- Created: 2014-09-13T11:43:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-07T21:46:18.000Z (about 10 years ago)
- Last Synced: 2024-11-01T13:42:28.017Z (2 months ago)
- Language: PHP
- Size: 359 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tlassets-bundle
===============[![Build Status](https://travis-ci.org/electrotiti/tlassets-bundle.svg?branch=master)](https://travis-ci.org/electrotiti/tlassets-bundle)
TlAssetsBundle is an alternative to Assetic, it build your assets using NodeJS, GULP and custom Twig tags on a Symfony2 project.
__WARNING: This bundle is under development, do not use on production.__
## How it works ?
__1:/__ In your Twig template, use the tags "style" and "js" to give assets source path and optional filters__2:/__ The parser, find all Twig template with these tags and create a JSON buffer file in cache that describe
the location of source path, the destination filename and some others options__3:/__ The compiler read the buffer files previously created and compile the final assets with GULP
The goal of these two steps (and not one step like assetic does), is to parse your Twig template only when your assets
definition change, and compile your assets only when you modify the content of your assets file.## Prerequisites
First you have to install in your environment this tools:
* Node JS
* NPM## Installation
### Gulp and dependencies
In order to install Gulp and his dependencies, execute command this command :
````
php app/console tlassets:gulp:install
````
## Tags TwigBelow an example of tags that you can use in your Twig
```` Twig
{% style "@MyCustomBundle/Resources/public/less/" filter="less" %}
{% endstyle %}{% js "@MyCustomBundle/Resources/public/js/" %}
{% endjs %}````
## Install your assets:
````
php app/console assets:install
````
_This command (from Symfony), copy your assets from the folder : "src/" to the folder : "web/bundles/"_## Quick assets compilation
To compile quickly your assets you just have to do this:
````
php app/console assets:dump
````
_This command do a tlassets:flush, a tlassets:parse and a tlassets:compile"_## Generate your assets step by step
Alternatively (and it's why this bundle is different of Assetic), each task on assets construction can be do separately
### Flush previous compilation
````
php app/console tlassets:flush
````
_This command remove cache and assets previously generated in order to have a clean environment_### Parse Twig template
````
php app/console tlassets:parse
````
_This command parse your Twig template and create a JSON file on the cache directory that will be used by GULP_### Compile assets
````
php app/console tlassets:compile
````
_This command retrieves all file buffer previously created with the parsing command and compile the final assets files_