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
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
99
Other Decks in Technology
See All in Technology
Claude Codeは仕様駆動の夢を見ない
gotalab555
23
7.4k
あとはAIに任せて人間は自由に生きる
kentaro
3
970
なごミュ@SPAJAM2025 第二回予選
1901drama
0
110
文字列の並び順 / String Collation
tmtms
1
120
[OCI Technical Deep Dive] OCIで生成AIを活用するためのソリューション解説(2025年8月5日開催)
oracle4engineer
PRO
0
130
AIは変更差分からユニットテスト_結合テスト_システムテストでテストすべきことが出せるのか?
mineo_matsuya
5
2.9k
Gaze-LLE: Gaze Target Estimation via Large-Scale Learned Encoders
kzykmyzw
0
270
あなたの知らない OneDrive
murachiakira
0
180
kintone開発チームの紹介
cybozuinsideout
PRO
0
73k
意志の力が9割。アニメから学ぶAI時代のこれから。
endohizumi
1
110
アカデミーキャンプ 2025 SuuuuuuMMeR「燃えろ!!ロボコン」 / Academy Camp 2025 SuuuuuuMMeR "Burn the Spirit, Robocon!!" DAY 1
ks91
PRO
0
150
LLM 機能を支える Langfuse / ClickHouse のサーバレス化
yuu26
9
2.8k
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Side Projects
sachag
455
43k
Building an army of robots
kneath
306
45k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Facilitating Awesome Meetings
lara
55
6.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
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