Good practices for gulp é¢è¥¿ããã³ãã¨ã³ãUG主å¬ãFRONTEND CONFERENCE 2016ãã§ã®çºè¡¨è³æã§ãã http://kfug.jp/frontconf2016/ https://github.com/jmblog/gulp-the-good-parts
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? ãã®ãã¹ãã¯ãWhy I Left Gulp and Grunt for npm Scriptsãçè ã®è¨±è«¾ãå¾ã¦æ訳ãããã®ã§ããééããããã¾ãããããææããã ããã¨å¹¸ãã§ãã ï¼ä»¥ä¸ãè¨³ï¼ ç§ã¯Gulpã¨Gruntãä¸è¦ãªæ½è±¡åã¬ã¤ã¤ã¼ã ã¨æ°ã¥ãã¾ãããnpmã®scriptsã¯ã¨ã¦ãå¼·åã§ããã£ã¡ã®æ¹ã便å©ã ã£ãããã¾ãã ä¾ãæãã¾ããã ç§ã¯ãã¤ã¦ã¯Gulpã大好ãã§ããããããçµå±ã®ã¨ããã100è¡ãã®gulpfileã¨å¤§éã®gulpãã©ã°ã¤ã³ãæ±ããã¡ã«ãªãã¾ãããGulpä¸ã§WebpackãBrowsersyncãMo
ã¯ããã« ä»æ¥ã¯ã¯ã©ã¤ã¢ã³ããµã¤ãWebã¢ããªã±ã¼ã·ã§ã³ã®éçºç°å¢æ§ç¯ã«ã¤ãã¦æ¸ãããã¨æãã¾ãã æ¨ä»ãHTML, JS, CSSãé§ä½¿ããWebã¢ããªéçºã®å ´ã«ããã¦ããã¿ã¹ã¯ã©ã³ãã¼ã®å°å ¥ã¯å½ããåã¨ãªã£ã¦ãã¾ããã åãæ¥é ã®æ¥åã§ã¯ããã³ãã¨ã³ãç¨ã®ã¿ã¹ã¯ã©ã³ãã¼ã¨ãã¦gulpã使ã£ã¦ãã¾ãã gulpã«ã¤ãã¦ã¯å¥½ããªã¨ãããå«ããªã¨ãããããã¾ããããã¼ã ã§ä»äºãããä¸ã§ã¯ä½ããã®ã¿ã¹ã¯ã©ã³ãã¼ã¨ãã«ãã¹ã¯ãªããã®åå¨ãæ¬ ãããªãã®ã¯å¦å®ãã¾ããã ããããå人çã«æ°ãããã¬ã¼ã ã¯ã¼ã¯ãã¡ãã£ã¨åå¼·ãããã¨ãã«Gruntãgulpã®ã¹ã¯ãªãããã¼ãããä½æããã®ã¯ãæ£ç´è¨ã£ã¦å¿ãæãã¾ãã YeomanãSlushJSã§ã¸ã§ãã¬ã¼ã¿ãæ¢ãã®ãæã§ãããèªåã®å¥½ã¿ã®ãã¬ã¼ã ã¯ã¼ã¯ããã©ã³ã¹ãã¤ã©ãã»ããã§æä¾ãããªãã±ã¼ã¹ããã°ãã°ã§ãã ãããªãã¨ãçµå±èªåã§gulpfile.
I know what youâre thinking. WAT?! Didnât Gulp just kill Grunt? Why canât we just be content for a few minutes here in JavaScript land? I hear ya, but⦠Iâve found Gulp and Grunt to be unnecessary abstractions. npm scripts are plenty powerful and often easier to live with. Letâs Begin With An Exampleâ¦I was a big fan of Gulp. But on my last project, I ended up with 100âs of lines in my gulpfile and
JavaScriptã§Algoliaã®APIãå©ãã¨ãã«ãAPP IDã¨APIã®KEYãå¼æ°ã«æ¸¡ãå¿ è¦ããããã ãã©ãããããå¤é¨ãã¡ã¤ã«ã«ãã¦ãGitã«ã³ãããããªãããã«ãããã£ããã©ãwebpackã®è¨å®ãã©ãæ¸ãã°ããã®ãããããããªãã¦ã¤ããã£ãã®ã§ã¡ã¢ã Vue.jsãwebpack v4ã§ãã«ããã¦ãç°å¢ã§ãã dotenvã®ã¤ã³ã¹ãã¼ã« $ npm install dotenv --save ã»ãã«ãdotenv-webpackã¨ããããããã£ã¦ãã©ããã¤ããã°â¦ï¼ã£ã¦ãªã£ã¦ãã .envã®ä½æ ã«ã¼ãç´ä¸ã«.envã¨ããååã®ãã¡ã¤ã«ãä½æãã¦ã以ä¸ã®ãããªæãã§ä¿åããã APP_ID=***** API_KEY=***** .envãignore .envãGit管çåããé¤å¤ããããã«ã.gitignoreã«.envã追è¨ããã webpackã®è¨å® webpack
çµè« Sprocketsã®åä½ãç¶æãã¤ã¤ãnpmãgulpãªã©ã®ã¢ãã³ãªãã¯ã¼ãåãå ¥ãããããã¨ãã©ããªç°å¢ãæ§ç¯ãã¦ã¿ãã ããããã㨠SEOã®ãããReactã§server-side renderingãããã JSã³ã¼ããES6ã§è¨è¿°ããã æ¢åã®CoffeeScriptã®ã³ã¼ããå ±åããããï¼å¾ã»ã©æ¸ãæããäºå®ï¼ npmãgulpã¨ãã£ãã¢ãã³ãªç°å¢ã§ã¢ã»ãã管çãããã browserifyã使ããã Sprocketsãå®ç¾ãã¦ããæ©è½ã¯ç¶æããã ããããSprocketsã¯ä½ããã¦ããã å¨ç¥ã®ãã¨ã§ãããã念ã®ããããããã ãã¡ã¤ã«æ¯ã®ä¾åé¢ä¿ã®ç®¡ç application.jsãªã©ã®ããã¥ãã§ã¹ããã¡ã¤ã«ããã£ã¦ãã㨠altJSã®ã³ã³ãã¤ã« ã¢ã»ããã®minify ã¢ã»ããã®é£çµ ã¢ã»ãããã¡ã¤ã«åã«MD5ãã£ã³ã¬ã¼ããªã³ããæ¿å ¥ Sprocketsã®åé¡ç¹
Rin 3.0 ã¨ããã®ãä½ã£ãã Rin - A lean, gulp-based HTML and SASS boilerplate by sanographixåã¯ãããããã©ã¤ãã®Webãµã¤ããä½ããã¨ãå¤ããã ãã©ãããããå¶ä½æã«ä½¿ã£ã¦ãããã¬ã¼ã ã¯ã¼ã¯ã¨ãããBoilerplateçãªãã¤ã§ãã ãã¬ã¼ã ã¯ã¼ã¯ã¨ãã£ã¦ããBootstrapã®ããã«CSSãã¢ãªã¢ãªæ¸ãã¦æ±ç¨ã³ã³ãã¼ãã³ããç¨æãã¾ãããã¨ãããµãã«ã¯ãã¦ããªããçµå±åwebãµã¤ãã§ãã¶ã¤ã³ã®è¦ä»¶ã大ããç°ãªãå ´åãå¤ãã®ã§ãCSSé¨åã®è¨è¿°ãã§ããã ãå°ãªããã¦ãåãµã¤ãåãã«æè»ã«ã¹ã¿ã¤ã«ãæ¸ããããã«ããæ¹éãã¨ã£ã¦ãããä¸æ¹ã§ãã«ããã¼ã«ã«æ±ãããããã¨ã¯å²ã¨æ¯åä¸ç·ãªãã¨ãå¤ãã®ã§ãgulpã§ãã°ããç°å¢æ§ç¯ãã¦ãã¹ã¿ã¤ã«ã¯åãµã¤ãã§ãããªã«ãã¿ãããªé°å²æ°ã Rinã¯ãã ãããä¸è¨ã®ãããªãã¨ããã°
æè¿ãGruntããgulpã«åãæ¿ãå§ãã¦ãã人ãå¢ãã¦ããæ°ããã¾ãããã®æ°ã¶æã§ããããªããã°ãªããã§ãå°å ¥è¨äºãå¢ãã¦ãããã§ãããã²ã¨ã¤è¨ã£ã¦ããã¾ãã¨ãæ°ã¶æåã®è¨äºã¯éµåã¿ã«ãã¦ã¯ãããªãï¼ã¨ãããããã®ã¾ã¾ã ã¨åããªããã¨ãããããï¼ãããªãããªãã¦ã ãããã©ãããããããã¨è³ªåãåããããããã§ãããããããªäººãã¯ã¾ã£ã¦ãåå ã¯ããã辺ã«ããæ°ããã¦ãªããªãã®ã§ãããããããªããã§ãã¡ãã£ã¨ãã®è¾ºã®è©±ãã¾ã¨ãã¦ããããã¨ç«ã¡ä¸ãã£ã次第ã§ãã â»ãã®è¨äºã¯2014å¹´7æ30æ¥æç¹ã®ãã®ã§ãã®ã§ãæ°ã¶æå¾ã«ã³ã¬ãèªãã§ãæ¹ã¯ã注æãã ã¢ãããã¼ãã®é »åº¦ãé«ãã®ã§â¦ ãããã£ããã¼ã«ã®ã¢ãããã¼ãé »åº¦ã¯é«ããã®ã§ãããgulpã®ãã¼ã¸ã§ã³ã¢ããé »åº¦ãã¾ãã¾ãã§ç¾å¨ã®ææ°çã¯ãv3.8.6ãã«ãªã£ã¦ãã¾ãããã©ã°ã¤ã³ã使ãã°ããããæ©è½ã追å ãããã¨ãã§ãã¾ããããããã£ã
æè¿ã®ãã¹ãç°å¢ æè¿ãããã°æ¸ããªããã¡ã«ãã¾ãã èªåã®jså¨ãã®ãã¹ãããã«ãç°å¢ãå¤ãã£ã¦ããã å ·ä½çã«ã¯ãkarmaã¨ãgulpã¨ãã«å¤ãã£ãã ä»æ¥ã¯ã ãã®ç°å¢ã«ãã¦ã©ãã ã£ããï¼ã¨ãã è¨å®ãã¡ã¤ã«(gulpfile)ã¨ãæ¸ãã¦ã¿ãã å»å¹´ã¨ä»å¹´ã¨ å»å¹´ãåå¼·ä¼çã§yeomanã¨ãgruntã®è©±ããã¦ãã¦ããã®blogã§ãã©ããã«æ¸ãã¦ãã ãã¹ãã¯mocha chaiãè¯ãã®ããªã¼ã¨æã£ã¦ãããããblogæ¸ããã æããä¸ã®ä¸ã©ãã©ãå¤ãã£ã¦ããã æè¿ã®ç°å¢ ä»ã¯ãããªæãã build tool gulp test jasmine2 sinon karma gulp vs Grunt gulpã©ããªãã ããï¼ã¨æããªããè²ã 試ãã¦ãããã¡ã«ãããªããã£ããããã stream baseã§æ¸ãæãã®ã§ãã«ã¹ã¿ãã¤ãºãæãã gruntã¯ãè¨å®ãã¡ã¤ã«ãä½ç»é¢ã«ã渡ã£
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}