Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
Gruntã使ã£ã¦ã人ã«ãgulpã£ã¦ã©ããªã®ï¼ãã¨èãããæ©ä¼ãæè¿ä½åããã£ãã®ã§ããã¾ãããªããèªåã®ææã交ãã¦çãã¦ã¿ãã ã¾ããèªåãããããããã¸ã§ã¯ããå§ããã¨ãããgulpã使ãã§ããããçç±ã¯è³ªåã«çããªããæ¸ãã¦ããã¾ãã Grunt使ãç¶ãã¡ãã ããªã®ï¼ ããã§ãããããªããGruntã«ååæ £ãã¦ãã¦ãã¿ã¹ã¯ã®ãã³ãã¬ã¼ãããã£ã¦ããã«éçºã«å ¥ãããªãGruntã使ãç¶ãã¦ãããã¨æãã¾ãããã ãä»ã¯Gruntã¨gulp両æ¹ã¨ã使ããã¦ãã¾ãããã©ã£ã¡ãè¦æ¨©ãæ¡ãããããã¾ãããGruntããç¥ããªãã¾ã¾gulpã®æ代ãæ¥ãã¨ãã«ãã¦ãã¦ã®å·®ãå¤å°åºãããããã¾ããã ããããªããGruntãçæéç¨åº¦ã«ä½¿ã£ã¦ãã¦ãè¨å®ãã¦ãã¿ã¹ã¯ãããã¼ã«ã«ãµã¼ãã¨ã©ã¤ããªãã¼ãããã¨minifyç³»ãããããªäººãªãgulpã触ã£ã¦ã¿ã価å¤ã¯ããã¨æãã¾ããåãã¿ã¹ã¯ãgulpã§ã
Scenario: you work on a fairly large project with other developers. Getting the rest of the team to run tests before the build has been problematic. If only you could ensure that tests ran before code could even be committed... Solution: Git Hooks to the rescue! Run anything you want before commits with the pre-commit hook. Like JSHint? Love unit testing? Run them before commits! The different hoo
7. module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), clean: { demo: ['build/*'] }, cssmin: { demo: { files: { 'build/css/demo.min.css': [ 'src/css/app.css', 'src/css/style.css' ] } } }, uglify: { demo: { options: { sourceMap: true }, files: { 'build/js/demo.min.js': [ 'src/js/app.js', 'src/js/util.js' ], 'build/asset/underscore/underscore.min.js': [ 'b
ä»åã¯ãGruntã使ã£ã¦Sassãã³ã³ãã¤ã«ãã¦ã¿ã¾ããGruntã®ã¤ã³ã¹ãã¼ã«ã«ã¤ãã¦ã¯ããã¡ãã®è¨äºã§ç´¹ä»ãã¦ããã¦ãã®ãã¡ããã覧ãã ãããSassã®è¨æ³ã«ã¯ãSCSSè¨æ³ã¨SASSè¨æ³ã®2種é¡ãããã¾ãããä»åã¯SCSSè¨æ³ã®ã¿å¯¾å¿ã«ãªãã¾ãã â»Sassã»Compassã¯ã¤ã³ã¹ãã¼ã«ããã¦ãããã®ã¨ãã¾ãã Gruntã§å¦çãããã㨠Gruntã«ã¯ãSassã¨Compassãã³ã³ãã¤ã«ãã以å¤ã«ãæ§ã ãªä¾¿å©æ©è½ãããã¾ãã ä»åãä¸è¨ã®æ©è½ã使ã£ã¦ã¿ããã¨æãã¾ãã Sassãã¡ã¤ã«ãã³ã³ãã¤ã«ãã livereloadã§Sassãã¡ã¤ã«ãæ´æ°ãããããã©ã¦ã¶ããªãã¼ãããã ãã©ãã©ã«è¨è¿°ãããã¡ãã£ã¢ã¯ã¨ãªãã¾ã¨ãã CSSã®ããããã£ã®é çªãæãã ãã©ã«ãæ§æ ãã©ã«ãæ§æã«ã¤ãã¦ã¯ä¸è¨ã®éãã§ãã project âcss (CSSã®åºåå ) âsass ââsty
ã¾ããã¦ãã¡ã¢ã ä»åã¯ST2ã§ã³ã¼ãã£ã³ã°ãã¦ã¦ãcss 㯠SCSS ã§æ¸ã㦠Grunt watch ã§ã³ã³ãã¤ã«ãã¦ã¾ãã ã§ãã¡ããã¡ããã¨è²ããªæ¡ä»¶ã®ä¿®æ£ã¨ããã¦ãã¨ãwatchãã¦ãã¿ã¼ããã«ã®ã¿ããåããã¨ã«ãªã£ã¦ä½æ¥ãåå«ã«ãªã£ã¦ãã¾ãã¾ãã é å¼µã£ã¦ååã¤ãã¦ããã©ããæ¯åã©ã®ã¿ãéãã°è¯ããåãããªããªã(´・_ï½¥`) ãªã®ã§ãSublime Text2ããwatchã§ããªãããªãã¨æã£ã¦ã¡ãã£ã¨èª¿ã¹ã¦ã¿ã¾ããã çµæããããäºãåºæ¥ãã¿ããã®ãªã®ã§ãã£ã¦ã¿ã¾ããã sublimetext2 â Sublime Text 2 build with Grunt v0.4.0 â Stack Overflow ãã ããwatch ã§ã¯ãªã grunt ã³ãã³ãã§ããã©ãå㯠grunt ã grunt watch ã ãã§ããã°ããã§ååãªã®ã§ããã§è¯ãã¨ãã¾ãã Grun
女å大çãããããåãã¦ããããªãã«ã®ãµã¼ãã¹ãæ·±å¤ã§ã使ãã風ä¿ã¨ãã¦ãèªåã®æ®ãããè±ãã«ãã¦ããã¦ããããªãã«ã§ããæå大å¦ã«éã女æ§ãæåããä»åã¯ãæãåºããã ãã§ãè奮ãç¦ã£ã¦ããã»ã©ãç´ è¡ã®æ°æã¡è¯ãã¯æ¿å ¥ãè¶ ãããããã®æè¦ã§ããããã®ç§å¯ã¯ææãªã¯ãªã«ããã¾ããç´ è¡ãããã¨ã©ãã©ãåºæ¿ããã¦ã¯ãªãåºããªãããããäºé ã«å½ãã£ã¦æ°æã¡è¯ããç¸æãæ¦ãã¦æ°æã¡è¯ãã¨ããç¸ä¹çãªé åã«æµ¸ãã®ããä»ã¾ã§ã®é¢¨ä¿å²ä¸æé«ã®ä½é¨ã«ãªã£ãã®ã§ããç´ è¡ã¯ããã¡ãªããããã®ã§ãããããã§ãå¯ç度ãé«ãã¦ã¢ã½ã³ã¸ã®åºæ¿ã¯ååãããã»ã©ãéä¸ã§èãããã¨ã諦ãã¦ããã°ããã£ã¨ãµã¼ãã¹ããååãæ¶åããªããã¡ã«æã¦ã¦ãã¾ã£ã¦ããã¨æãã¾ããããããåã¯é¢¨ä¿MASTERã§ãããããªãã¨ã§ãã¾ããããã¹ã大好ãããããã¯ã³ããããå¾ã§ãä½åº¦ã¨ãªãããã¥ã¼ãã¦ã»ãããã¨ãé¡ããããã®ã§ãèã絡ãã¦ãã£ã
ååã®è¨äºã§JS HintãCSS Lint çãGruntã使ã£ã¦å®è¡ããæ¹æ³ãæ¸ããããgruntãã«ãèªä½ãå®è¡ãããã¨ãå¿ãã¦ã³ããããã¦ãã¾ã£ãããã¾ãæå³ãç¡ãã®ã§ãã³ãããããç´åã«å®è¡ããããã«ãã¦ã¿ãã ããã¸ã§ã¯ãã®.git/hooks以ä¸ã« pre-commitãã¡ã¤ã«ãé ç½®ããã #!/bin/sh grunt build pre-commitãã¡ã¤ã«ã«ã¯å®è¡æ¨©éãä»ä¸ chmod u+x .git/hooks/pre-commit ããã§git commit ããæã«gruntãã«ããèµ°ããã¨ã©ã¼ããã£ãå ´åã¯commitãä¸æ¢ãããããã«ãªããå¿ ããã§ãã¯ãèµ°ã£ããã®ããã³ããããåºæ¥ãªããªããããããããªãã®ãä¸ãã£ã¦ãã¾ããã¨ããªããªãã ãã ããã ã¨ãä¸é¨ã®ä¿®æ£ã ããã³ããããããå ´åããã以å¤ã®ã¯ã¼ã¯ããªã¼ä¸ã«ãããã¡ã¤ã«ã®ããã§ãã«ãã¨ã©ã¼ã«ãªã£ãå ´å
éçºä¸ã¨ãªãªã¼ã¹ãã«ããããã¦èããã éçºä¸ã¯ã¨ã«ããé度éè¦ããã¹ãéè¦ã ãªãªã¼ã¹ãã«ãã®ã»ãã«ãèªååã§ãã便å©ãªã¿ã¹ã¯ãåºæ¥ãã ãçªã£è¾¼ãã§ããã éçºä¸ã«ä½¿ç¨ããã½ã¼ã¹ãã¡ã¤ã«ããããªãªã¼ã¹ãã«ãã«ä½è¨ãªãã¡ã¤ã«ãæ··ããªãã ãããªèãæ¹ã§Gruntfileãæ¸ãã¦ã¿ã¾ããã ããã¸ã§ã¯ããã¨ã«æé©åããGruntfileãä½ãã¨ãããã¨ãé åçãªææ¦ãªã®ã§ãããç§ã¯éçºè ä¸äººã§çç´æãªæ¡ä»¶ãããã¤ãããªããªãã¨ãããªãã®ã§ããã®ããã«å°å ¥ããã¿ã¹ã¯ã©ã³ãã¼ã®ã¯ããªã®ã«Gruntfileã®éçºãã¡ã³ãã«æéãåãããã®ã¯æ¬æ«è»¢åã«ãªã£ã¦ãã¾ãã®ã§ãåºæ¥ãéãæ±ç¨çã«ä½¿ããããã«æ°ãã¤ãã¦æ¸ãã¾ããã ããã«ä½ãç¹å®ã®éçºã¹ã¿ã¤ã«ããã¬ã¼ã ã¯ã¼ã¯ã«ä¾åããªãããã«ãç¹æ®ãªãã£ã¬ã¯ããªæ§æãªã©ãå¿ è¦ã¨ããªãç¹ãæ°ãä»ãã¾ããã æ®æ®µã¯éçºã¯ç§ä¸äººã§ããããã¶ã¤ãã¼ãã³ã¼ãã¼ãéçºè
ä»å㯠grunt ã³ãã³ãã®è£å®é¢æ°ãä¾ã¨ã㦠ãã£ãã·ã¥æ©è½(cache-policy) ã«ã¤ãã¦è§£èª¬ãã¦ããã¾ãã grunt ã«ã¤ãã¦ã¯ç¥ããªãã¦ã大ä¸å¤«ã ã¨æãã¾ãã ãã£ãã·ã¥æ©è½(cache-policy) ã«ã¤ãã¦ã®è§£èª¬ãã¡ã¤ã³ãªã®ã§ãzsh è£å®é¢æ°ã®åºæ¬çãªèª¬æã¯çç¥ãã¾ãã ãã®ä»£ãããã³ã¼ãå ã«ã³ã¡ã³ãã§ç°¡åãªèª¬æãæ¸ãã¾ããã®ã§ãã¡ããåèã«ãã¦ä¸ããã â» ã¨ã¦ãé·ãè¨äºãªã®ã§ã誤åè±åãããããããã¾ãããã容赦ä¸ãããm(_ _)m (è¦ã¤ãããæãã¦ãããã¨å©ããã¾ã) ã¯ããã« grunt ã«ã¯æ¨æºã§ bash ã®è£å®ãã¤ãã¦ãã¾ãã ããããzsh ç¨ã®è£å®é¢æ°ã¯ç¡ããbash ã®è£å®ã¨åãæ¹æ³ã§å®è£ ããã®ã§ã¯ãªãã·ã§ã³ãã¿ã¹ã¯ã®èª¬æã表示ããã¾ããã ãªãã·ã§ã³ã®èª¬æã¯ãã¿æ¸ãã§ããã¨ãã¦ããã¿ã¹ã¯ã®èª¬æã¯ããã¯ããã¾ããã ã¨ãããã¨ã§ä½æããã®ã
bashã®è£å®ã¯å ¬å¼ã§æä¾ããã¦ããããgruntã®zshè£å®ããªãã£ãã®ã§ä½ã£ãã ç§ãåå¨ãç¥ããªãã ããããããªãã®ã§ãç¥ã£ã¦ãæ¹ããããæãã¦ãã ããã (zsh-completions 㨠oh-my-zsh ã«ã¯ãªãã£ãã1ã¤ã ãgithubã«ãã£ããã©å¾®å¦ã ã£ãã) ã¡ãªã¿ã«å ¬å¼ã®bashè£å®ã¯ã以ä¸ã®è¨å®ã .bashrc ãªã©ã«è¨è¿°ããã°ä½¿ç¨åºæ¥ã¾ãã eval "$(grunt --completion=bash)" zshè£å®ã¤ã¡ã¼ã¸ ã¤ã³ã¹ãã¼ã«æ¹æ³ Githubã«ç½®ãã¦ããã®ã§ã¨ã£ã¦ãã¦ä¸ããã yonchu/grunt-zsh-completion · GitHub $ git clone git://github.com/yonchu/grunt-zsh-completion.git or $ wget https://github.com/yonchu/gr
Gruntã§ã¯Headlessãªã¦ããããã¹ããè¡ãããã® Qunit ãããã¾ããããããå人çã«ã¯RSpec風ã«è¨è¿°ã§ãã Jasmine ã®æ¹ãèªã¿ãããã®ã§ãJasmineã§ã®ã¦ããããã¹ãç°å¢ãæ§ç¯ãã¦ã¿ã¾ããã ã¾ããGrunt Jasmine runner ãã¤ã³ã¹ãã¼ã« [shell] $ cd /your-project $ npm install grunt $ npm install grunt-jasmine-runner [/shell] PhantomJSããªãå ´åã¯Brewã§ããã¦ãã [shell] $ brew install phantomjs [/shell] èªèº«ã®grunt.jsãã¡ã¤ã«ã«è¿½å [js] // Jasmine jasmine: { // ãã¹ãããããã®ã½ã¼ã¹ãã¡ã¤ã« src : âpath/to/project/*.jsâ, //
æ¨æ¥ã®ç¶ãã ããããã¢ããªã±ã¼ã·ã§ã³ã®ãã³ãã¬ã¼ãã管çããã®ã«ä¾¿å©ãªä»çµã¿ã¯ãªãã§ãããã¼ã¨è¨ã£ã¦ããã @teppeis ããã @omo2009 ããã« Grunt ã Yeoman ã¯ã©ããã¨æãã¦ããã£ãã Grunt ã¯ã¦ã¼ã¹ã±ã¼ã¹ã¨ãã¦ã¯ JavaScript ã®é£çµãå§ç¸®ãSCSS/LESS ãªããã®ã¡ã¿è¨èªã®ã³ã³ãã¤ã«ãããã¨ãã«ä½¿ããã®ãã¤ã¾ã rake ãªããã¨åããããªãã®ã¨ä»¥åã«ãã©è¦ããç¨åº¦ã§ç¥ã£ãæ°ã«ãªã£ã¦ãããã©ããã¡ãã£ã¨éã£ã¦ãããGrunt ã¯ç¢ºãã«ã¿ã¹ã¯ã©ã³ãã¼ã§ã¯ããã®ã ããNode.js ã§å®è£ ãã¦ããå©ç¹ãååã«æ´»ããã¦ãä»»æã®ãã¡ã¤ã«ãæ´æ°ãããã®ãããªã¬ã«ä¸é£ã®ã¿ã¹ã¯ãå®è¡ãããããGrunt 㧠Webãµã¼ãã¼ãç«ã¡ä¸ãã¦ä»ã®ã¿ã¹ã¯ã¨é£æºããããã¨ãã£ããã¨ãã§ããããã«ãªã£ã¦ããããã©ã°ã¤ã³ã®ä»çµã¿ããã£ã¦ãã¨ã³ã·ã¹ãã çã«çµæ§æ´»çºã«
2012/12/08 Gruntã¨ã¯ grunt: a task-based command line build tool for JavaScript projects ãã¯ã説æä¸è¦ã®å¯è½æ§ãããã¾ããã gruntãgrunt-cliã¸ã®ç§»è¡(?)ããããã¨ããããã¾ã¨ãã¦ã¿ã¾ããã ã³ãã³ãã©ã¤ã³ã§ä½¿ç¨ãããã«ãã¿ã¹ã¯ã®ãã¼ã«ã§ãã js(ã»ã¼json)ã®è¨å®ãã¡ã¤ã«ä¸ã«ãconcatãminifyã¨ãã£ããããªã¿ã¹ã¯ãå®ç¾©ãã ã³ãã³ãã©ã¤ã³ããå®è¡ãã¾ããè¨èã ãã ã¨ã¤ã¡ã¼ã¸æ¹§ãã«ããã¨æãã¾ãã®ã§ã 使ã£ã¦ãããã®ãä¸çªã¨è¨ãå¼µã£ã¦å°å ¥æé ã®èª¬æã«å ¥ãã¾ãã npmããgrunt-cliãã¤ã³ã¹ãã¼ã«ãã ï¼nodeã¨npmã¯ã¤ã³ã¹ãã¼ã«æ¸ã¿ã»ã»ã»ããï¼ï¼ npm install -g grunt-cli ããã§æ ¸ã¨ãªãCLIã®ã¤ã³ã¹ãã¼ã«ã¯å®äºã§ãã ã¿ã¼ã
ãã»ã»ã ã¯ã¦ãªãã¤ã¢ãªã¼ã®ä½¿ãã¥ããã¤ã³ã¿ãã§ã¼ã¹ãªãã¨ããã¦ããã£ã¦æã£ã¦ãé³¥ããã ã ãã¦ãgruntã£ã¦ããnode.jsã使ãã¨ãCSSãJavaScriptå¨ããè²ã ã¨èªååã§ããã¨èãã¦ã使ã£ã¦ã¿ããã gruntã§ã§ãããã¨ãgrunt watchãã§ç£è¦ãã¦ããã¨ãä¸æ¸ãä¿åããéã«èªåçã«è²ããªãã¨ããã¦ããããã ãä¾ãã°ã»ã»ã» ãã¡ã¤ã«ã®çµå JavaScriptãã¡ã¤ã«ã®ããªãã¼ã·ã§ã³ JavaScriptãã¡ã¤ã«ã®è»½éåï¼å§ç¸®ãminifyï¼æ©è½ã追å ãããããããªãã¨ãã§ããããã«ãªãããï¼ä»ã«ãæ¢ãã°ããããï¼ CoffeeScriptãã¡ã¤ã«ã®ã³ã³ãã¤ã« Lessãã¡ã¤ã«ã®ã³ã³ãã¤ã« CSSãã¡ã¤ã«ã®å§ç¸® CSSãã¡ã¤ã«ã®ããªãã¼ã·ã§ã³ gruntã®å°å ¥ãã¦ãç°å¢ãæ§ç¯ãããã ã¾ããnode.jsã®ã¤ã³ã¹ãã¼ã«ã¨ãnode.jsã®ããã±ã¼ã¸ç®¡çã·ã¹ãã np
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}