This is a Symfony Edition that replaces Assetic with a grunt configuration. I have some taken some liberties based on my development style. When doing frontend development, I don't like waiting for some kind of watch task. I like my updates to be instant. This edition allows for your frontend assets to be linked to the source in development and linked to the minified version in production.
- npm
- bower (
sudo npm install -g bower
) - grunt (
sudo npm install -g grunt-cli
)
> composer install
> bower install
> npm install
> grunt
clean
: removesweb/_static
contentsjshint
: detect errors in your javasciptuglify
: minify your javasciptcssmin
: minify your cssmodernizr
: install/configure modernizr based on your javascript files\- (default): runs all the above
To configure the assets for you project, add them to app/config/assets.json
. Both Symfony2 and grunt use
this configuration.
bower.json
: bower package configuration.bowerrc
: bower configuration to install frontend assets toweb/vendor
package.json
: npm package configuration (for grunt)app/config/assets.json
: global asset configurationapp/config/config.php
: sets a Symfony2 parameter based on the aboveassets.json
configurationgruntfile.js
: configures grunt, assets for minification are pulled from the aboveassets.json
web/css/main.css
/web/js/script.js
: test assets
app/config/config.yml
: added twig global variableapp_assets
which is set to the parameter set inconfig.php
app/Resources/views/base.html.twig
: modified thestylesheets
andjavascripts
block to load these assets based on the aboveapp_assets
configuration (app.debug=true
: source is used,app.debug=false
: min is used)
- Removed Assetic
- Simplifed DemoBundle
- Removed
bootstrap.php.cache
- use composer's--optimize-autoloader
option