Giter Club home page Giter Club logo

grunt-demo's Introduction

Grunt demo

This is a sample project that uses Grunt for automating common tasks.

This code has been extracted from my quickstart guide to Grunt: Power-Up Your Front-End Development With Grunt.

Requirements

  • Node and npm (see NodeJS
  • Install grunt-cli globally: npm install -g grunt-cli

Once you have installed the requirements, checkout this repository and run npm install:

git clone [email protected]:belen-albeza/grunt-demo.git
cd grunt-demo
npm install

Included tasks

Workflows

These are high level tasks that build up common work flows in development.

Run a server and re-compile asssets:

grunt server

The task above will lint your code, compile Sass stylesheets, run a local server, open a browser pointing to the app, and watch for changes to Sass file so they are automatically recompiled.

We can also run tests in the console, or run them in a browser:

grunt test
grunt test:browser

The tasks above will lint your code, and run your Jasmine specs. When using test:browser it will automatically run a local server and open the browser for you.

There's a task to generate a release (ie: code for production) of your app:

grunt release

That will compile your Sass stylesheets optimized for production, run your Jasmine tests and generate a zip you can use for deployment in a server.

Other tasks

Lint your code (see custom JSHint rules in .jshintrc):

grunt jshint

Clean all temporary and release files:

grunt clean

Compile your Sass stylesheets for development or production:

grunt sass:dev
grunt sass:prod

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.