You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
ãã®è¨äºã¯ JavaScript Advent Calendar 2016 ã®13æ¥ç®ã®è¨äºã§ã æ®æ®µã¯ npm script ãæ¸ãäºãå¤ãã§ãã Gulp ã使ããã¨ãå°ãããã®ã§ãGulp ã§å®è¡ãããã¿ã¹ã¯ã®ã¨ã©ã¼ãã³ããªã³ã°ã«ã¤ãã¦èª¿ã¹ã¦ã¿ã¾ãã ã¾ãã¯ããã«ä¸è¬çãªgulp.task ã®å®ç¾©ã«ã¤ãã¦ãããããããã¨æãã¾ãã Gulp ã¿ã¹ã¯ãå®ç¾©ããå ´åã«ã¯ãSyncãCallbackãPromiseãStream ã®4ã¤ã®æ¹æ³ãããã¾ãã Sync
ããã³ãã¨ã³ã front end ããã¯ã¨ã³ã back end ã¢ããªéçº app ã¤ã³ãã© infra ãã®ä» other ãã¼ã¿ããªãã³ data driven ã¿ã°ä¸è¦§ Ajaxï¼1ï¼ Androidï¼20ï¼ Apacheï¼2ï¼ ARï¼2ï¼ benchmarkï¼1ï¼ BigQueryï¼2ï¼ browsersyncï¼1ï¼ C4ï¼1ï¼ CakePHPï¼1ï¼ CentOS7ï¼1ï¼ CIï¼1ï¼ CMSï¼3ï¼ CoreNFCï¼1ï¼ CraftARï¼1ï¼ CSSï¼1ï¼ DeepLabï¼2ï¼ Dmitry Stogovï¼1ï¼ ECMAScriptï¼1ï¼ ECMAScript6ï¼1ï¼ ElePHPantï¼1ï¼ Facebookï¼3ï¼ FFmpegï¼1ï¼ firebaseï¼1ï¼ fluentdï¼1ï¼ Frameworkï¼1ï¼ GDï¼2ï¼ gifï¼2ï¼ Gitï¼1ï¼ GLSLï¼5ï¼ Google A
SVGã¹ãã©ã¤ãã£ã¦ããªããè¤éãªã¤ã¡ã¼ã¸ãããã¾ãããï¼ åã¯ããã§ããããªãããé¢åãããããããã©ãããå§ãã¦è¯ããããããªããããã¨ãã£ãæãã§ãã£ã¨æãã¤ããããã«ãã¾ããã ã§ããä»åãã£ã¦ã¿ã¦æã£ããã§ãããä¸åº¦ã¯ã¼ã¯ããã¼ã確ç«ãã¦ãã¾ãã°ã¢ã¤ã³ã³ç®¡çãããªã便å©ã«ãªãã¾ããCSSã¹ãã©ã¤ãã®æããã管çã楽ã«ãªãã¾ããã表示ãµã¤ãºãä»å¾ã®é«è§£å度対å¿ãæ°ã«ããªãã¦è¯ããªãã®ãå¬ããã§ããã SVGã¹ãã©ã¤ãã«ã¤ãã¦ã®è±èªã®ãªã½ã¼ã¹ã¯ããã®ã§ããã説æãå¤ããã¨ã£ã¤ãã«ãããã®ãå¤ãå°è±¡ãªã®ã§ãããã§ã¯ã§ããã ãã·ã³ãã«ã«å¿ è¦ãªãã¨ã ããã¾ã¨ãã¦ã¿ããã¨æãã¾ãã ã§ã¯ãSVGã¹ãã©ã¤ãã»ã¢ã¤ã³ã³ã·ã¹ãã ã®Gulpã使ã£ãã¯ã¼ã¯ããã¼ã®æ§ç¯ãå§ãã¾ãããï¼ ç®æ¬¡ éæãããã㨠ãã¢ãã¼ã¸ SVGã¹ãã©ã¤ãã®ä»çµã¿ ãã©ã¦ã¶ãµãã¼ã ç¨æãããã® å°å ¥ã¹ããã æå¾ã« éæ
//- ãã¼ã¹ããJSONãã¼ã¿ãæ ¼ç´ããã°ãã¼ãã«å¤æ° - var data = {} //- JSON æ§æããã¼ã¹ãã¦ã°ãã¼ãã«å¤æ°ã® data ã«ãã¼ã¿ãæ ¼ç´ãã mixin mixin json(name) - var oldbuf = buf - buf = [] block - data[name] = JSON.parse(buf.join('')) - buf = oldbuf //- å¤é¨ JSON æ å ±ã®èªã¿è¾¼ã¿ +json('site') include site.json //- å¼ã³åºã h1: a(href=data.site.root) #{data.site.name} 解説 jade æ¨æºåºåã横åãã㦠JSON ããã¼ã¹ãã¦ã¾ãã æå¾ã«èªã¿è¾¼ãã JSON ãæ¨æºåºåãããªããããããã¯ã¢ãããã¦ãã buf ãæ¸ãæ»ãã¦ã¾ãã buf 㯠jad
大éã®ååãã¼ã¿ãHTMLã«æ¿å ¥ããéãJSONãã¡ã¤ã«ã¨EJSã使ç¨ãã¦æ¥½ã«HTMLã«æ¸ãåºããã¨ãã§ãã¾ããï¼ EJSã¨JSONã使ç¨ãã¦ããã£ãã㨠EJSã®è¦ãç®ãHTMLã ãããã使ãã JSã®foræã§HTMLã®ç¹°ãè¿ãã®è¨è¿°ãæ¸ããªããªã£ã¦æ¥½ï¼è¦ãç®ãã£ãã ååãã¼ã¿ï¼ååã»åå詳細ã»ç»åãã¹ã»URLãªã©ï¼1ãã¡ã¤ã«ã§ç®¡çã§ãã¦ä¿®æ£ã楽 ã¨ããããã§ãã£ã¡ãã©ã¯ãã³ã§ããâ¡â¡â¡â¡(âãε:) EJSã¨ã¯ ååJade(Jadeã®ãã³ãã¬ã¼ããextends&blockã§ç¶æ¿ããã便å©ã«éçºã§ãã)ãç´¹ä»ããã®ã§ãããEJSããã³ãã¬ã¼ãã¨ã³ã¸ã³ã®1ã¤ã§ã Embedded JavaScriptã®ç¥ã§è¦ãç®ã¯HTMLãªã®ã§ãããJavaScriptã®ãããªæ¸ãæ¹ãã§ãã¦ãæçµçã«ã¯HTMLã«ãªã£ã¦çæãã¦ããã¾ã Jadeã¨åããheader/footerãã¢ã¸ã¥ã¼ã«ã«åãã¦
ç®ç Pug(Jade)ã«JSONãªãã¸ã§ã¯ãã渡ãã¦æ¥½ããããã¨ãããã¨æãã { "title":"æé«ã®Webãã¼ã¸", "description":"æé«ã®Webãã¼ã¸ã§ã", "author":"æé«ã®ä½è " } html(lang="ja") head title=title meta(name='description',content=description) meta(name='author',content=author) pugãã¡ã¤ã«å ã§ãªãã¸ã§ã¯ããå¤æ°å®£è¨ãããã¨ãã¦ãè¤æ°è¡ã«æ¸¡ãå¤æ°å®£è¨ã¯ã¨ã©ã¼ã«ãªã£ã¦ãã¾ãã®ã§ããªãã¸ã§ã¯ããæ¸ãã¥ããã¨ããåé¡ãããã ãªã®ã§ãjsonã§ãªãã¸ã§ã¯ããæ¸ãã¦ãããã©ãã«ããã¦pugå ã§includeãã¦ãããªã«ãããããã¨ãªããã ãã©ãjsonãã¡ã¤ã«ãpugã®ä¸ã§includeãã¦ä½¿ããã¨ã¯ã§ããªãã®ã§ããããã©ããã
ãã£ã¬ã¯ããªæ§é ã¯ä»¥ä¸ã®åæã§ã®è¨å®ã gulpfile.js package.json /dist /src â /_jade â /_data â setting.json â /aaa â index.html â /bbb â index.html var data = require('gulp-data'); var DEST = './dist'; var SRC = './src'; var SRC_HTML = ['./src/**/*.jade', '!./src/**/_jade/*.jade', '!./src/**/_*.jade']; gulp.task('jade', function() { return gulp.src(SRC_HTML) .pipe(data(function(file) { var c, filename; if (file.path
ç¾å ´ã§ä½¿ããgulpå ¥é 第1å gulpã¨ã¯ä½ã ãã¾ãã¾ãªä½æ¥ãèªååãããã«ãã·ã¹ãã gulpã®åºç¤ã解説ãã¾ãã第1åç®ã¯ãgulpã¨ã¯ä½ãï¼ãèªååã®ã¡ãªããã¯ã©ãã«ããã®ãæ¦è¦³ãã¤ã³ã¹ãã¼ã«ããç°¡åãªã¿ã¹ã¯ãèµ°ããã¦ã¿ã¾ãã ã¯ããã« ãã®ã·ãªã¼ãºã§ã¯ãJavaScriptã§æ¸ããããã«ãã·ã¹ãã ã§ããgulpï¼ã¬ã«ãï¼ã«ã¤ãã¦ãå°å ¥ãã使ãæ¹ãªã©ãåºæ¬çãªé¨åã解説ãã¾ãã ãªããè¨äºå·çæç¹ã®gulpã®ãã¼ã¸ã§ã³ã¯3.8.7ã§ãã 第1åç®ã§ã¯ãã¾ãããªãgulpã®ãããªãã¼ã«ãå¿ è¦ãªã®ãããã¼ã«ã®èæ¯ã«è§¦ãã¾ããããã«gulpã®æ¦è¦ã¨ãç°å¢è¨å®ãä¸å¿ã«è§£èª¬ãã¾ãã gulpã¨ã¯ gulpã¯Node.jsããã¼ã¹ã¨ãããã«ãã·ã¹ãã ãã«ãã¼ã§ãã以åCodeGridã§ãç´¹ä»ããGruntã¨ä¼¼ãç®çãæã£ã¦ä½ããããã¼ã«ã§ãgulpã使ãã°ãã¾ãã¾ãªä½æ¥ãèªååãããã¨ãã§ã
CSS Nite LP47 Coder's High 2016 http://cssnite.jp/lp/lp47 ãã¤ãããã®ã³ã¼ãã¼ç°å¢æ§ç¯ãã§çºè¡¨ããã¹ã©ã¤ãã§ãã â»ã¹ã©ã¤ãä¸ã®URLãªã³ã¯ã¯å¹ããªãã®ã§ãä¸é¨æåèµ·ããããé£ãã§ãã ãããRead less
ã¯ããã« èªå㯠Twitter Bootstrap ã«ãã»ã©çåãæãã¦ããªãâ¦ä¾ãã°ãï¼ã¯ã½ï¼ãã¼ã¯ã¢ããåé¡ããã¶ã¤ã³ãåãæ§ã«ãªã 1 â¦ãã®è¾ºã¯å¾è¿°â¦ç¨åº¦ã«ã¯ãããã³ãã¨ã³ãéçºã«çãäºã ãã¯ã ã¤ã¾ãã¯ããåã¯ä½ãè¨ã£ã¦ãã ãã ãããªããã®æ稿â¦ä¸éå端ãªç¥èãæ¯ããããã¦ãææºè¼ãããªããã¨ã ãã¦ã ä½ã§ç¥ã£ããè¦ãã¦ãªããã©ã Refills ã試ãã¦ã¿ããã¨ã ãããåææ¡ä»¶ã¨ãã¦ã Bourbon 㨠Neat ãå¿ è¦ã¨ã®äºã§ãããããæå³ããäºã¯ä½ã¨ãªãåãããã©ãããããè¸ã¾ããä¸ã§ã©ããã£ã¦ä½¿ãã®ãããã³ã¨æ¥ãªãã£ãã æ¥æ¬èªæ å ±ãæ¼ã£ã¦ããBourbonãNeatãæ´ã«ã¯ Bitters ã¾ã§ã¯æ å ±ã¨ãã¦å¾ãäºãã§ãã¦ããããã³ãã¨ã³ãéçºã«çãèªåã«ã¯ãRefillsæ¬å®¶ãµã¤ãã«ã³ããç¨ã³ã¼ããããã¨ã¯ãããå ·ä½çã«ã©ã®æ§ã«æãåããã¦ããã°è¯ãã®ããã
var gulp = require('gulp'); var gutil = require('gulp-util'); var browserify = require('browserify'); var source = require("vinyl-source-stream"); gulp.task('browserify', function(){ return browserify('./js/main.js') .bundle() .on('error', function(err) { gutil.log(err); this.emit('end'); }) .pipe(source("app.js")) .pipe(gulp.dest('./dist')); }); gulp.task('watch', function(){ gulp.watch('./js/*.j
ããã³ãã¨ã³ãã®ãä»äºã¨ãã¦ãHTMLãCSSãJavaScript ã®ã³ã¼ãã£ã³ã°åããè¡ã£ã¦ããã¨ã以åã«æ¯ã¹ã¦ãããªããã°ãªããªããã¨ãå¢ãã¦ãã¦ãã¾ããããã®ãããç´°ã ããä½æ¥ã§ããèªååãã¦å¹çããéçºãããããªãã¨ãæéãããã£ã¦ãã¾ããã¨ãå¤ãã§ãã ãããªã¨ãã«æ´»ç¨ã§ããã®ããä»å使ãæ¹ãç´¹ä»ãã gulp ã§ãã gulp.js ãã®ã¨ã³ããªã¼ã§ã¯ãgulp ã使ããããã«ãgulp ã¨ã¯ã©ããããã®ãªã®ãã®ç°¡åãªèª¬æãããå°å ¥ã®åºç¤é¨åã¾ã§ãæ¸ãã¦ããã¾ããã³ããã§ãã使ã£ããã¨ããªãï¼ã¨ãã人ãã誰ãã®ã³ããã«é ¼ã£ã¦ä½¿ã£ã¦ãããããªäººããä»å¾ã®æ´»ç¨ãã¦ããããã®åèã«å©ç¨ãã¦ãããããå¬ããã§ãã gulp ã¨ã¯ï¼ gulp.js 㯠Node.js 製ã®æ¯åè¡ããããªä½æ¥ãèªååãã¦ããããã¼ã«ã§ããããæ§ã ãªãµã¤ãã§ã¿ã¹ã¯ã©ã³ãã¼ã¨ãã¦ç´¹ä»ããã¦ãã¾ãããæ£ç¢ºã«ã¯
gulpfile.js ã®åå²æ¹æ³ã«ã¤ãã¦ã gulp ã¿ã¹ã¯ãå¢ãã¦ãã㨠gulpfile.js ãé·ããªã£ã¦ã¡ã³ããã³ã¹ãã¥ãããã¾ããã¿ã¹ã¯éã§å ±éãããè¨å®ãããã¨ãã¦ãããã gulpfile.js å ã§å®ç¾©ãã¯ãããã¨æ´ã«ãã¡ã¤ã«ã¯ä¼¸ã³ã¦ããããã®åé¡ã解決ããããã以ä¸ã®ããã¸ã§ã¯ããåèã«ã¿ã¹ã¯ãåå¥ãã¡ã¤ã«ã¨ãã¦å®ç¾©ãã¦ã¿ãã greypants/gulp-starter ãã£ã¬ã¯ããªæ§æ ããã¸ã§ã¯ãã®ãã£ã¬ã¯ããªæ§æã¯ä»¥ä¸ã®ããã«ãªãã / â package.json â gulpfile.js â gulp/ â â config.js â â tasks/ â â â gulp ã¿ã¹ã¯ãã¨ã®ãã¡ã¤ã« â â util/ â â gulp ã¿ã¹ã¯ã§å©ç¨ãã便å©ã¢ã¸ã¥ã¼ã« â bower_components â â ã¢ããªããå©ç¨ãã Bower ã¢ã¸ã¥ã¼ã« â
ãªãgulpfile.jsãES6ã§æ¸ãã®ï¼ ES6ã«ã¨ãããã触ãã¦æ £ãã¦ã¿ããã¨ããå ´åã«ãã¾ãã¯gulpfile.jsã§è©¦ãã¦ã¿ãã¨ããããã¨ãã風潮ãããã¿ãããçç±ã¯ãã¶ã次ã®ãããªæãããªã¨æã£ã¦ãã ä»ã¸ã®å½±é¿ãå°ãªã ã³ã¼ãã®åéãå°ãªã å®è£ ã«ãã¾ãé ã使ããªãã§æ¸ãã ç°å¢ã«ãã£ã¦ã¯babelçã®ãã©ã³ã¹ãã¤ã©ãã¤ã³ã¹ãã¼ã«ããã«ES6ããã®ã¾ã¾ä½¿ãã ç°å¢ãæºåãã gulpfile.jsã§ES6ã使ããããã«ããã«ã¯ãgulpå´ã§å¯¾å¿ããããNode.jså´ã§å¯¾å¿ãããã©ã¡ããã«ãªãã¾ãã gulpå´ã§ES6ã«å¯¾å¿ãã gulpã¯v3.9.0ããbabelãæ¨æºãµãã¼ãããããã«ãªã£ãã®ã§ãbabelãä»ãã¦ES6æ§æãå©ç¨ã§ããããã«ãªãã¾ããã ãã ããES6æ§æã使ãå ´åã¯ããã¡ã¤ã«åãgulpfile.babel.jsã«ããå¿ è¦ãããã¾ã gulpã®ãã¼ã¸ã§
ããã«ã¡ã¯ï¼ã®ã£ã¶ãªã¼ã§éçºãæ å½ãã¦ããæå¡ï¼ inureoã§ãã ä»åã¯ã¿ã¤ãã«éãwebpack + babel-loaderã§ES6ããã¥ã¼ãã¤ã¤ãgulpãES6ã§æ¸ããã¨ããã¨ããããã£ã¦ã¿ããã¨æãã¾ãã gulpfile.jsãES6ã§æ¸ããã¨æã£ãçç± ãES6ãããããªã¼ããããæ¥åã«ç´çµããã¨ããã§ããã¨èãã¦ããæã«ããã¡ãã®è¨äºã®gulpfile.js ãES6ã§æ¸ãçç±ãæè¦ãã¦ããããã«gulpfileãªãå®è£ ã«é 使ããªããæ £ããã®ã«ã¯ããã¿ãªã ï¼ãã¨æã£ãããã§ãã æ©éES6ã§gulpfileãæ¸ãã¦ãã gulpfileãES6ã§æ¸ãã«ã¯ãgulpå´ã§ES6対å¿ãããããnode.jså´ã§ES6対å¿ããããã®2æã«ãªãã¾ãã gulpå´ã§ã®å¯¾å¿ gulpã®3.9.0ããbabelãæ¨æºãµãã¼ãããããã«ãªãã¾ããããã¡ã¤ã«åãgulpfile.babel.
main-bower-files 㨠gulp-inject 㨠gulp-usemin ãçµã¿åããã - Gulp ã§ä½ã Web ããã³ãã¨ã³ãéçºç°å¢ #6 wakamsha 2015.06.29 92 19122635 ããã³ãã¨ã³ãéçºç°å¢ãç¨æããã®ã« npm ãå©ç¨ããã®ã¯ããã¨ä¸è¬çã«ãªã£ã¦ãããã¨æãã¾ããGrunt ããã Gulp ããããBrowserify ãã¯ããã¨ããä¾åé¢ä¿è§£æ±ºãçµåã»å§ç¸®ã¨ãã£ãéçºãã®ãã®ãè£å©ããã©ã¤ãã©ãªã®å¤ãã¯ãnpm ããåå¾ãããã¨ãåºæ¥ã¾ãã ã§ã¯ãjQuery ã AngularJS ã¨ãã£ãéçºæã ãã§ãªããã©ã¦ã¶ããèªã¿è¾¼ãã§ä½¿ãã©ã¤ãã©ãªã«é¢ãã¦ã¯ã©ã®ããã«ç¨æãã¦ã¾ããï¼ãããã®é¡ã®å¹¾ã¤ã㯠npm çµç±ã§ãåå¾ã§ãã¾ãããå ¨ã¦ã§ã¯ããã¾ããããããã£ããã®ã«é¢ãã¦ã¯å¥ã®æ¹æ³ã§åå¾ããå¿ è¦ãããã¾ãã人ã«ãã£ã¦æ¹æ³
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}