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
Grunt: The JavaScript Task Runner
Search
Sebastiaan Deckers
February 25, 2013
Programming
8
410
Grunt: The JavaScript Task Runner
Slides for my talk at Front-end Developers User Group (Singapore)
Sebastiaan Deckers
February 25, 2013
Tweet
Share
More Decks by Sebastiaan Deckers
See All by Sebastiaan Deckers
Commons Host: Building a CDN for the rest of the world
sebdeckers
1
140
SVG Reality
sebdeckers
5
150
About Sebastiaan
sebdeckers
0
150
Frontend 100
sebdeckers
1
500
Frontend 101
sebdeckers
4
550
Frontend 102
sebdeckers
3
500
Frontend 103
sebdeckers
2
490
Frontend Testing
sebdeckers
3
350
Other Decks in Programming
See All in Programming
コードとあなたと私の距離 / The Distance Between Code, You, and I
hiro_y
0
190
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
250
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
450
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
610
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
360
iOSでSVG画像を扱う
kishikawakatsumi
0
160
CSC305 Lecture 09
javiergs
PRO
0
310
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
280
Devvox Belgium - Agentic AI Patterns
kdubois
1
140
Flutterで分数(Fraction)を表示する方法
koukimiura
0
140
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
12
7.1k
Ktorで簡単AIアプリケーション
tsukakei
0
100
Featured
See All Featured
Side Projects
sachag
455
43k
Code Reviewing Like a Champion
maltzj
526
40k
A better future with KSS
kneath
239
18k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
How GitHub (no longer) Works
holman
315
140k
Facilitating Awesome Meetings
lara
57
6.6k
A designer walks into a library…
pauljervisheath
209
24k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
What's in a price? How to price your products and services
michaelherold
246
12k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
KATA
mclloyd
PRO
32
15k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Transcript
The JavaScript Task Runner
What is Grunt? Grunt is like Ant, Make, Rake, SCons,
etc. but, Javascript. NPM.
build script
Automate your build So you can: ... do continuous integration,
... release to production without fear, ... work on more interesting things.
Is Grunt for me? frontend backend mixed Backbone, Ember, Angular
REST/WebSocket API Express.js
Grunt Plugins grunt-contrib: 26 and growing Community: 450+
None
Using Grunt 1. Create package.json 2. Gruntfile.js 3. Run npm
install 4. grunt [task[:target]]
package.json { "name": "hello-world", "version": "0.1.0", "dependencies": { "grunt": "~0.4.0",
"grunt-contrib-jshint": "~0.1.1", "grunt-contrib-uglify": "~0.1.1" } }
Gruntfile.js module.exports = function (grunt) { grunt.initConfig({ uglify: { build:
{ src: 'app.js', dest: 'build/app.min.js' } }, jshint: { all: ['**/*.js'] } }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.registerTask('default', ['jshint', 'uglify']); };
Have it your way Declarative Imperative
Demo
Poor Man's CI $ sudo -i # crontab -e */5
* * * * cd /var/www/myapp.com && git reset --hard && git pull origin master && npm install && npm test && grunt
I am Sebastiaan I email
[email protected]
I blog ninja.sg I
work cf.sg I code git.io/seb