Project setup
Now we have installed Node.js, npm and Grunt, we're ready to create our first Grunt environment. Let's say we've already built a website, now we want to use Grunt to minify our assets. In this section, we'll learn about the two required files: the package.json
file and the Gruntfile.js
file, as well as a recommended directory structure.
package.json
The package.json
file is a package descriptor; it is used to store all metadata about the module, such as name, version, description, author, repository, and more. It's the single file required to effectively use npm, therefore, the package.json
file can also be thought of as the "npm file". As the file extension would suggest, it must be in the
JavaScript Object Notation (JSON) data format. ...
Get Getting Started with Grunt: The JavaScript Task Runner now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.