Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to gruntjs
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Sam Mason
September 24, 2013
Technology
1
280
Introduction to gruntjs
A short talk given at Untangle the web on 24/09/2013 @ Skills Matter Exchange
Sam Mason
September 24, 2013
Tweet
Share
More Decks by Sam Mason
See All by Sam Mason
Working with Gulp, Neat & Bourbon
samjbmason
0
1.2k
Git & Github 101
samjbmason
5
200
First steps in the web - Wordpress as a CMS
samjbmason
2
110
Other Decks in Technology
See All in Technology
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
5
1.1k
Evolution of Claude Code & How to use features
oikon48
1
210
ヘルシーSRE
tk3fftk
2
240
GitLab Duo Agent Platform + Local LLMサービングで幸せになりたい
jyoshise
0
110
AI時代にエンジニアはどう成長すれば良いのか?
recruitengineers
PRO
1
140
Kiro のクレジットを使い切る!
otanikohei2023
0
110
開発組織の課題解決を加速するための権限委譲 -する側、される側としての向き合い方-
daitasu
4
240
Security Diaries of an Open Source IAM
ahus1
0
200
LLM活用の壁を超える:リクルートR&Dの戦略と打ち手
recruitengineers
PRO
1
240
OpenClawで回す組織運営
jacopen
2
390
「ストレッチゾーンに挑戦し続ける」ことって難しくないですか? メンバーの持続的成長を支えるEMの環境設計
sansantech
PRO
1
310
Introduction to Bill One Development Engineer
sansan33
PRO
0
380
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
14k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.7k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
180
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
170
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
310
[SF Ruby Conf 2025] Rails X
palkan
2
810
The Language of Interfaces
destraynor
162
26k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
63
53k
Color Theory Basics | Prateek | Gurzu
gurzu
0
230
Transcript
Intro to grunt
Hi I’m Sam Mason, a Developer at Benchmark @samjbmason http:/
/mason.io
Intro to grunt
What is grunt? Not this This
Runs all the tasks grunt.initConfig({ Buy Presents: { for girlfriend:
{ Price: >£100 }, for sister: { Price: <£10 } } });
grunt loves git The configuration is just a javascript file
so it can be added to git and shared
install node Go to http://nodejs.org/ Install the correct package. Fin!
install grunt-cli `npm install -g grunt-cli` In the terminal, type
To actually install grunt part 1 package.json In your project
folder, create Gruntfile.js &
To actually install grunt part 2 package.json { "name": "my-project-name",
"version": "1.0.0" } Then run in terminal npm install grunt --save-dev
grunt is installed in your project package.json { "name": "your-project",
"version": "1.0.0", "devDependencies": { "grunt": "~0.4.1" } }
install the grunt-contrib plugin Terminal npm install grunt-contrib --save-dev
grunt is installed in your project package.json { "name": "your-project",
"version": "1.0.0", "devDependencies": { "grunt": "~0.4.1", "grunt-contrib": "~0.7.0" } }
the gruntfile - wrapper function Gruntfile.js module.exports = function(grunt) {
// All your code goes in between here };
the gruntfile - load plugin Gruntfile.js module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib'); };
the gruntfile - configuration wrapper Gruntfile.js grunt.initConfig({ // All your
configuration goes in here });
the gruntfile - configuration wrapper Gruntfile.js grunt.initConfig({ sass: { dist:
{ options: { style: 'compressed' }, files: { 'css/main.css': 'css/main.scss' } } } });
the gruntfile - register tasks Gruntfile.js grunt.registerTask('default', ['sass']);
Setting up multiple tasks Gruntfile.js grunt.registerTask('default', ['sass']); grunt.registerTask('prod', ['sass','uglify']);
the gruntfile Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ sass: {
dist: { options: { style: 'compressed' }, files: { 'css/main.css': 'css/main.scss' } } } }); grunt.loadNpmTasks('grunt-contrib'); grunt.registerTask('default', ['sass']); }
the gruntfile - configuration wrapper Gruntfile.js grunt.initConfig({ uglify: { my_target:
{ files: { 'js/main.min.js': ['js/main.js'] } } } });
Run the task Terminal - from your project folder grunt
Thanks for listening @samjbmason http:/ /mason.io