Nette and Grunt task grunt-usemin for min. css and js files
- chemix
- Nette Core | 1310
Hi, i update my example repository https://github.com/…/Nette-Grunt where is basic config for combine Nette and Grunt.
I'm using these blocks in @layout.latte template:
<!-- build:js {$basePath}/js/app.min.js -->
<script src="{$basePath}/js/netteForms.js"></script>
<script src="{$basePath}/js/helpers.js"></script>
<script src="{$basePath}/js/lightbox.js"></script>
<!-- endbuild -->
for automated building minified js and css with Grunt
- srigi
- Nette Blogger | 558
Well, how did you manage usemin
-ing of HTML with
{$basePath}
in front of path? grunt-usemin
is not
updating this script tags, cos it is unable to find file with that name on
the disk.
Recently I also finished boilerplate of Nette & Grunt integration. I solved lots of things there including the above one (by forking usemin). Unfortunately it is not OSS yet (will be probably), but if you ask I can share important pieces.
- chemix
- Nette Core | 1310
i wrote little npm module grunt-nette-basepath that solve problem with {$basePath} string in paths https://github.com/…tte-basepath
- chemix
- Nette Core | 1310
This is ENGLISH/CZECH draft, is it ok?
https://docs.google.com/…RNt8SLM/edit?…
comments are welcome…
Last edited by chemix (2014-03-26 11:29)
- Patrik Votoček
- Member | 2221
<OT>Just question. Why do you write this short post about czech “article” on english forum?</OT>
- o5
- Member | 416
I just want to suggest a great task called grunt-watch. It should be added to your grunt/nette skeleton for others, who don't know it. I discovered development with grunt-watch + livereload a few weeks ago and now I don't want to change :)
- chemix
- Nette Core | 1310
PV: sended (https://github.com/…docs/pull/94)
Q: i used the same (and one) folder for all css files like for minified version and i don't have this problem. But if you need something special try add other plugin http://gruntjs.com/plugins for example: https://www.npmjs.org/…-url-replace maybe solve your problem or use data-uri https://www.npmjs.org/…unt-data-uri
this article is only for start :) i'm using too more plugins