The initial project folder structure should look like this: project In this tutorial we will build this workflow: use Sass to write the stylesheets, CoffeeScript for scripts, introduce asset pipeline (concatenation and minification) and live reload of the page whenever there is a change in source files. First you need to install Grunt for the command line as a global module, after which you have grunt command available globally. Run those tasks in the command line while you work.Create package.json and list dependencies (Grunt and plugins).Let’s first breakdown a typical workflow to get a big picture: cleaning and copying files and folders,.concatenation and minification of assets,.Sass, Less and CoffeeScript processing,.There are close to 4,000 Grunt plugins available for different tasks such as: Grunt’s functionality depends on plug-ins and those depend on your needs. All the configuration is done in regular Javascript (or CoffeeScript). Grunt.js uses power of Node.js to work and it runs from your command line. If you work in a team environment that means you can work with a set of unified commands and everyone will share a common workflow. The configuration takes some time to set up, needs some project and asset planning but it will save you a lot of time in the long-run. Doing this manually soon becomes tiring as you spend a lot of time on repetitive, menial tasks, AKA grunt work.Ī solution to that problem is to automate all menial tasks into automated Grunt tasks. Let’s say you’re a front-end developer and you use Sass, some CoffeeScript, need to minimize your stylesheets and scripts (asset compilation), and on top of that you want to see changes in real time in your browser whenever you change a source file. The project’s homepage lists many big players in software development that use Grunt in their development as part of continuous integration workflow. It runs custom defined repetitious tasks and manages process automation. Grunt is a command line Javascript task runner utilizing Node.js platform.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |