Automate with Grunt: The Build Tool for JavaScript by Brian P. Hogan

By Brian P. Hogan

Grunt is in all places. JavaScript initiatives from jQuery to Twitter Bootstrap use Grunt to transform code, run checks, and convey distributions for construction. it is a construct device within the spirit of Make and Rake, yet written with glossy apps in brain. This booklet will get you on top of things with Grunt utilizing functional hands-on examples, so that you can wrangle your tasks very easily. you will how to create and keep projects and venture builds, and automate your workflow with plugins and customized tasks.

JavaScript has moved from being the language you like to hate to the language you should utilize. And as JavaScript functions get extra complicated, you would like a technique to regulate that complexity. whereas on-line tutorials simply clarify how one can slap jointly a configuration dossier, this e-book is going extra and indicates you the way to create your individual projects, layout your individual venture templates, mix plugins jointly to deliver an online app to lifestyles, and construct your personal plugins.

You'll begin via studying the fundamentals of activity production, mistakes dealing with, and logging as you create an easy configuration that executes easy JavaScript code utilizing Node.js. Then you will leap correct into dossier manipulation as you learn, write, reproduction, and delete documents. you will find out how Grunt's strong multitasks paintings as you construct a job to concatenate documents jointly. as soon as you may have a clutch on those fundamentals, you will construct an easy app with AngularJS and CoffeeScript, utilizing Grunt to do all of the heavy lifting and script processing. ultimately, you will create your individual plugin so that you can know the way plugins work.

Each bankruptcy includes hands-on routines and concepts for additional learn. no matter if you rock Ruby or sling C#, Grunt may be an invaluable addition for your toolbox.

What You Need:

This e-book covers Grunt 0.4.1 and better, and calls for simple wisdom of JavaScript and command-line instruments on home windows, OS X, or Linux.

Show description

Read or Download Automate with Grunt: The Build Tool for JavaScript PDF

Similar javascript books

Smashing Node.js: JavaScript Everywhere (Smashing Magazine Book Series)

Discover ways to make extra effective apps, with only one language!

Smashing Node. js: JavaScript all over equips you with the required instruments to appreciate Node. js and its makes use of in constructing effective internet apps. With extra conventional net servers turning into out of date, having wisdom on servers that in attaining excessive scalability and optimum source intake utilizing Node. js is the most important for your app improvement good fortune. educating you the necessities to creating event-driven server-side apps, this booklet demonstrates how one can use much less house and take much less time for communique among net purchaser and server.

* comprises quite a few hands-on examples
* Explains implementation of real-time apps together with Socket. IO and HTML5, and WebSockets
* Addresses useful Node. js merits from particular layout choices
* Demonstrates why wisdom and use of JavaScript is beneficial
* comprises an interactive on-line part with pattern chapters
* Explains parts of stand out apps together with brevity and benchmarks

Looking to reinforce your talents even additional? Smashing Node. js: JavaScript in all places makes constructing server-side apps obtainable with its specialise in JavaScript, open resource, and easy-to-use language.

Scripting in Java: Integrating with Groovy and JavaScript

Scripting in Java teaches you ways to exploit the Java Scripting API and JavaScript to execute scripts and make the most of the beneficial properties of a scripting language whereas constructing Java purposes. The booklet additionally covers issues that let scripting languages to exploit Java good points and the Java classification library, together with the recent Java Collections and JavaFX eight APIs.

HTML, CSS & JavaScript Web Publishing in One Hour a Day

Completely revised and up to date with examples rewritten to comply to HTML5, CSS3, and modern internet improvement practices, this easy-to-understand, step by step instructional is helping you fast grasp the fundamentals of HTML and CSS ahead of relocating directly to extra complicated subject matters similar to portraits, video, and interactivity with javascript and jQuery.

Additional info for Automate with Grunt: The Build Tool for JavaScript

Sample text

What You Need You’ll need a computer running Windows 7 or 8 or a modern version of Linux or OS X. You’ll need the ability to install software on your computer, as well as an active Internet connection. You’ll also need a text editor or your IDE of choice. [2] You’ll find installers for all platforms there. Download the one for your operating system and install it using the default options. Finally, Grunt is a command-line utility, so you’ll use the Command Prompt on Windows or the Terminal on OS X or Linux.

And if there are folders within folders, we’ll have to handle those the same way. isDir to detect whether the source element is a file or a directory. If it’s a file, we print the file to the screen and do the file copy like before. recurse, which runs the callback function of our choice against each file or folder in the structure. recurse executes the callback, it sends the source file’s absolute path as the first parameter. It can send the root directory, the current file’s directory, and the current file’s name as arguments if the callback function accepts them.

WorkingDirectory'​)); ​ }); One of the biggest advantages of using these Grunt utilities instead of the raw operating-system commands is that they will work on multiple operating systems. The syntax for recursively deleting folders is very different between Linux and Windows. Now let’s look at how we copy the files over. Copying Files Our project may have lots of files that we don’t want to deploy to the web server. js or the node_modules folder if we’re building a basic website. So we’ll need to tell Grunt what files we want to copy over.

Download PDF sample

Rated 4.48 of 5 – based on 33 votes