Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Grunt.js
Search
Matias Singers
January 29, 2014
Programming
180
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Grunt.js
Matias Singers
January 29, 2014
Other Decks in Programming
See All in Programming
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
AIと壁打ちしながら進めるコスト管理
fufuhu
2
2k
信頼性の目標を誰も求めてない
shubox
0
500
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
180
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
680
ALB ログから Trace を気合で繋げる技術
fohte
7
880
「AI時代、配布するPythonコードをどう守るか: 難読化の実験と判断軸」 #PyconJP2026
pkshadeck
PRO
2
180
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
100
AIに既存システムを理解させる技術 ~レガシーを見捨てないハーネスエンジニアリング入門~
ochtum
0
210
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
890
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
760
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
340
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
590
The Invisible Side of Design
smashingmag
301
52k
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
820
HDC tutorial
michielstock
2
860
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
500
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Transcript
None
Grunt
$ npm install -g grunt-cli Installation
Setup + Gruntfile.js package.json
$ npm init $ npm install grunt --save-dev $ npm
install grunt-contrib-connect --save-dev $ npm install grunt-contrib-watch --save-dev $ npm install grunt-contrib-sass --save-dev $ npm install load-grunt-tasks --save-dev Install Grunt plugins
1 { 2 "name": "my-project", 3 "version": "0.1.0", 4 "devDependencies":
{ 5 "grunt": "~0.4.2", 6 "grunt-contrib-connect": "~0.6.0", 7 "grunt-contrib-watch": "~0.5.3", 8 "grunt-contrib-sass": "~0.7.0", 9 "load-grunt-tasks": "~0.3.0" 10 } 11 } package.json https://npmjs.org/doc/json.html
• Loading Grunt plugins and tasks • "wrapper" function •
Project and task configuration • Custom tasks Gruntfile.js http://gruntjs.com/getting-started
1 module.exports = function(grunt) { 2 // instead of having
multiple grunt.loadNpmTasks(''); 3 require('load-grunt-tasks')(grunt); 4 5 // Do grunt-related things in here 6 }; Gruntfile.js - wrapper http://gruntjs.com/getting-started
1 module.exports = function(grunt) { 2 require('load-grunt-tasks')(grunt); 3 4 grunt.initConfig({
5 connect: { 6 options: { 7 port: 9001, 8 open: true, 9 hostname: 'localhost' 10 }, 11 server: { 12 // specific configs for the server task 13 } 14 }, 15 }); 16 }; Gruntfile.js - task configuration http://gruntjs.com/getting-started
1 // Default task(s). 2 grunt.registerTask('default', ['connect:server']); Gruntfile.js - custom
tasks http://gruntjs.com/getting-started
1 // Default task(s). 2 grunt.registerTask('default', ['connect:server']); Gruntfile.js - custom
tasks 1 // A very basic default task. 2 grunt.registerTask('default', 'Logger', function() { 3 grunt.log.write('Logging...').ok(); 4 }); http://gruntjs.com/getting-started
Gruntfile.js - custom tasks 1 grunt.registerTask('server', [ 2 'clean:server', 3
'sass:server', 4 'connect:server', 5 'watch' 6 ]); http://gruntjs.com/getting-started
http://gruntjs.com/plugins
http://gruntjs.com/plugins
None
Concatenating 1 concat: { 2 'js/main.js': [ 3 'js/controllers/events.js', 4
'js/controllers/login.js', 5 'js/controllers/menu.js' 6 ] 7 } module: grunt-contrib-concat
Concatenating module: grunt-contrib-concat grunt-usemin + 1 <!-- build:js js/main.js -->
2 <script src="js/controllers/events.js"></script> 3 <script src="js/controllers/login.js"></script> 4 <script src="js/controllers/menu.js"></script> 5 <!-- endbuild -->
Watching files 1 watch: { 2 sass: { 3 files:
['styles/**/*.{scss,sass}'], 4 tasks: ['sass:server'] 5 }, 6 livereload: { 7 files: [ 8 'views/**/*.html', 9 'scripts/**/*.js', 10 'styles/**/*.css', 11 'img/**/*.{png,jpg,jpeg,gif,webp,svg}' 12 ], 13 options: { 14 livereload: true 15 } 16 } 17 } module: grunt-contrib-watch
Watching files module: grunt-contrib-watch - Waiting... OK >> File "public/styles/main.sass"
changed. ! Running "sass:app" (sass) task ! Done, without errors. ... Reload public/styles/main.css ... Completed in 0.178s at Tue Jan 28 2014 12:22:51 GMT+0800 (MYT)
None
enjoy your automated workflow!
Advantages
@matiassingers github.com/matiassingers Thank you! Any questions?