npm install assetx> Manage front-end assets
AssetX manages front-end assets and takes care about dev/production environments
##### Work in progress, please take care.
```
$ npm install -g assetx
AssetX needs a yaml configuration file. Default is ./assetx.yml.
This is the configuration reference :
`ymlassetx.yml
js/app.js:
files:
- js/app1.js
- js/app2.js
# global options (except 'views') can be override on each asset
print.css:
files:
- css/print/*/.css
prodFolder: cdn_assets/css
prodBaseUrl: 'http://cdn.my-project.com'
tags:
twig: ''
tasks:
gulp-minify-css:
- { keepSpecialComments: 0 }
`
In view templates, insert AssetX tags for each asset defined in the assetx.yml
`twig`
{% if app.environment == 'prod' %}
{#assetx prod:css/style.css#}{#endassetx#}
{#assetx prod:print.css#}{#endassetx#}
{% else %}
{#assetx dev:css/style.css#}{#endassetx#}
{#assetx dev:print.css#}{#endassetx#}
{% endif %}
`bash``
~/my-project $ assetx
Some options and other commands are available, just run assetx --help for more information
Inspired by gassetic