background preloader

GRUNT.JS

Facebook Twitter

Ronan Levesque – Automatiser son workflow avec Grunt. Web Development Build Automaton Tools. Nobody likes doing boring and repetitive tasks.

Web Development Build Automaton Tools

The good news is we can probably make our computer do them for us. When it comes to web development build automation, there are two major players you will want to look at: Grunt and Gulp. But, which one should you go with? What are the differences between them? Which one is better? Choose: Grunt, Gulp, or npm? As a first step, let’s discuss where Grunt excels at.

Choose: Grunt, Gulp, or npm?

The single best aspect of Grunt is its ease of use. It enables programmers to develop build flows using JavaScript almost effortlessly. All that’s required is searching for the appropriate plugin, reading its documentation, and then installing and configuring it. This ease of use means that members of large development teams, who are often of varying skill levels, don’t have any trouble tweaking the build flow to meet the latest needs of the project.

The team doesn’t need to be fluent in Node either, they need to add properties to the configuration object, and task names to the different arrays that make up the build flow. Grunt for People Who Think Things Like Grunt are Weird and Hard. Front-end developers are often told to do certain things: Work in as small chunks of CSS and JavaScript as makes sense to you, then concatenate them together for the production website.

Grunt for People Who Think Things Like Grunt are Weird and Hard

Compress your CSS and minify your JavaScript to make their file sizes as small as possible for your production website. Optimize your images to reduce their file size without affecting quality. Use Sass for CSS authoring because of all the useful abstraction it allows. That’s not a comprehensive list of course, but those are the kind of things we need to do. Webdesign.tutsplus. Tutoriel Grunt. Dans les tutoriels précédents, vous avez eu un aperçu des deux types de tâches proposés par Grunt.

Tutoriel Grunt

Dans ce tutoriel, vous allez en apprendre les bases de l'écriture. Les tâches Grunt mises en file s'exécutent toujours séquentiellement : lorsqu'une se termine avec succès, la suivante peut commencer ; lorsqu'une tâche se termine en erreur, l'exécution de la séquence est interrompue. Ce mécanisme séquentiel fonctionne naturellement si le code des tâches est synchrone. En revanche, s'il comporte une composante asynchrone, cela peut casser la gestion continu-si-succès/stop-si-erreur de la séquence. Grunt pour ceux qui pensent que Grunt est compliqué. On parle beaucoup de Grunt aujourd'hui, mais les articles disponibles sont souvent abscons et techniques.

Grunt pour ceux qui pensent que Grunt est compliqué

Pourtant Grunt n'est pas réservé aux spécialistes, comme le montre cette introduction de Chris Coyier. Par Chris Coyier On donne souvent les conseils suivants aux intégrateurs web : Divisez votre CSS et votre JavaScript en autant de parties que nécessaire, puis concaténez-les pour la version de production de votre site. Compressez votre CSS, minifiez votre JavaScript, pour améliorer la performance de votre site.

Il y en aurait encore beaucoup à ajouter, mais voilà déjà quelques basiques. Comparison between gulp and Grunt. See for a write-up. A Simple Guide to Getting Started With Grunt. To define our configuration for Grunt, we will use our Gruntfile.js file.

A Simple Guide to Getting Started With Grunt

This is the default place where our settings will go. Advanced Grunt tooling. Grunt has made web development more enjoyable.

Advanced Grunt tooling

By automating repetitive tasks, it has allowed web developers to focus on building features rather than copying, compiling, and configuring. In this post, I will share some advanced tooling with Grunt which will help you use it to its full potential. Bash functions When using grunt frequently, it is nice to have shortcuts for installing plugins. Grunt Boilerplate. What is Grunt?

Grunt Boilerplate

InstallationPackage.jsonDependenciesGruntfile.jsSassRequireJSJSHintJasmine BDDImage MinificationHTML MinificationRegistering tasksWatching filesOur full Grunt fileConclusionUpdates Please note that any additional updates have been added to the bottom of this post to ensure no cross-over between the original focus and new items that might contradict that What is Grunt? Get Up And Running With Grunt. Advertisement In this article, we’ll explore how to use Grunt1 in a project to speed up and change the way you develop websites.

Get Up And Running With Grunt

We’ll look briefly at what Grunt can do, before jumping into how to set up and use its various plugins to do all of the heavy lifting in a project. We’ll then look at how to build a simple input validator, using Sass2 as a preprocessor, how to use grunt-cssc and CssMin to combine and minify our CSS, how to use HTMLHint3 to make sure our HTML is written correctly, and how to build our compressed assets on the fly. Lastly, we’ll look at using UglifyJS4 to reduce the size of our JavaScript and ensure that our website uses as little bandwidth as possible. 5Grunt.js6 is a JavaScript task runner that helps you perform repetitive tasks such as minification, compilation, unit testing or linting.

Getting Started with Grunt. Grunt is a task runner that can dramatically improve your front-end development workflow.

Getting Started with Grunt

With the use of a number of grunt plugins you can automate tasks such as compiling Sass and CoffeeScript, optimizing images and validating your JavaScript code with JSHint. You may have used something like CodeKit or Hammer to handle these tasks in the past. I think both of these apps are great (and have used them extensively in the past) but where Grunt wins out is customizability. There are masses of plugins available to help integrate everything from image optimizing to CSS style injection into your workflow. Getting Started with Grunt - SitePoint Premium. Pint. Grunt vs Gulp - Beyond the Numbers — Jack Hsu. Just when you think that you're in control, Just when you think that you've got a hold, Just when you get on a roll, Here it goes, here it goes, here it goes again. OK Go - Here It Goes Again And so the evolution of front-end development continues with Gulp, the new build system that has already garnered praise amongst many web developers.

Ronan Levesque – Automatiser son workflow avec Grunt. Grunt est un task runner dont le but est d’automatiser certaines tâches répétitives (compilation, minification etc). Il est écrit en JavaScript et fonctionne avec Node.js. Dans cet article j’expliquerai comment le configurer et le lancer de manière basique. Tutoriel Vidéo Grunt Découverte. Grunt pour ceux qui pensent que Grunt est compliqué. GruntJS pour les Nuls ! GruntJS, c’est quoi ? « Il était une fois les développeurs front-end qui travaillaient d’arrache-pied sur un projet, puis un autre projet, et d’autres encore. Ces développeurs effectuaient à chaque projet des actions répétitives et rébarbatives pour eux.

Ces tâches sont nombreuses, les plus connues étant : devoir minifier les fichiers avant mise en production, réduire le poids des images, concatener le code, etc. » Si vous êtes développeur front, il est fort probable que ces tâches restent pour vous une perte de temps avec des actions répétées dont chacun se passerait bien. Ce temps est révolu ! Premiers pas avec Grunt. Nous vous conseillons aujourd'hui d'utiliser un gestionnaire de tâches qui nous paraît être mieux sur bien des points: configuration plus souple, lisible et facile et rapidité vous attendent avec Gulp.

Vous avez sûrement déjà entendu parler de Grunt à droite à gauche, en conférence, voire votre boite l'utilise déjà mais vous ne savez toujours pas trop ce qui se cache derrière ce terme saugrenu digne d'un personnage de Warcraft. Soit, ce n'est pas bien grave. Avant et après Grunt.js. Avant / Après Slides Source. Gruntjs/grunt. Grunt: The JavaScript Task Runner.