From add2e2ae2ddc2d7b105d38914026c18a64531536 Mon Sep 17 00:00:00 2001 From: Muhammed Thanish Date: Wed, 21 Sep 2016 15:59:31 +0530 Subject: [PATCH 1/2] Serve the storybook favicon --- package.json | 1 + scripts/prepublish.sh | 1 + src/server/build.js | 1 + src/server/index.js | 2 ++ src/server/public/favicon.ico | Bin 0 -> 7269 bytes 5 files changed, 5 insertions(+) create mode 100644 src/server/public/favicon.ico diff --git a/package.json b/package.json index c41c2cf86cbe..578a82268f6e 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "redbox-react": "^1.2.2", "redux": "^3.5.2", "request": "^2.74.0", + "serve-favicon": "^2.3.0", "shelljs": "^0.7.4", "stack-source-map": "^1.0.5", "style-loader": "0.13.1", diff --git a/scripts/prepublish.sh b/scripts/prepublish.sh index bd17feebb68e..7aa0cb3fcfbf 100755 --- a/scripts/prepublish.sh +++ b/scripts/prepublish.sh @@ -4,5 +4,6 @@ echo "> Start transpiling ES2015" echo "" rm -rf ./dist ./node_modules/.bin/babel --ignore __tests__ --plugins "transform-runtime" ./src --out-dir ./dist +cp -r ./src/server/public ./dist/server/public echo "" echo "> Complete transpiling ES2015" diff --git a/src/server/build.js b/src/server/build.js index c37d257d1dfe..1e5e2f923677 100644 --- a/src/server/build.js +++ b/src/server/build.js @@ -47,6 +47,7 @@ config.output.path = outputDir; // create output directory (and the static dir) if not exists shelljs.rm('-rf', outputDir); shelljs.mkdir('-p', path.resolve(outputDir)); +shelljs.cp(path.resolve(__dirname, 'public/favicon.ico'), outputDir); // copy all static files if (program.staticDir) { diff --git a/src/server/index.js b/src/server/index.js index 980e1e947fef..818d6191ea49 100755 --- a/src/server/index.js +++ b/src/server/index.js @@ -2,6 +2,7 @@ import datastore from '@kadira/storybook-database-local/dist/server/middleware'; import express from 'express'; +import favicon from 'serve-favicon'; import program from 'commander'; import path from 'path'; import fs from 'fs'; @@ -51,6 +52,7 @@ if (program.host) { } const app = express(); +app.use(favicon(__dirname + '/public/favicon.ico')); if (program.staticDir) { program.staticDir = parseList(program.staticDir); diff --git a/src/server/public/favicon.ico b/src/server/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..31b707d749bd021c75a202d0c27ac0c2c510c6e6 GIT binary patch literal 7269 zcmcI}c|25K{P!I*#yVz5jNRC>W{Jo;wn&R5p|Z?GA?ue!wwcB*g-Wzw3Z;ZmNwUlg z2@#TIlr=((C1ULJT)+RH=bz_!?%a9ZdEGhp+|TEn&v}2|pZ5U(2>97QAb>1jF9`r5 z;O{htGd2ibabEBz;)Jc0)BeBvUv4;faStoK0sxXCC#=k!qkb%m424S#=F2QE9cvio zlrR^PwIz+i(;q9R-%@$>&S&Ah@9S)nf)lC-&+TLttF}A85~3Ebh!(HhwNuhVo-kH< z@%*{_i5r(sMxecXaCKo0ss^nH^C}df&7Cmvq!cGZ~z^>WQGNJ%Bvtm{&_t? zla|h^x`|459HSZlIx9OG1IDV%H>?_rgBk;y=u zWG0KDtGHy)E!eXe7khZ~}&bF-cOPv1fQfc-p=6&ybs?8V)#SXalL2G9XxCZ+_qz+8aQ%prJ(N&uG9(`!gV$uKj<} z#P6lM%-(K1ZLPV&r(X+5eb5%LMDIhI5eG*PTvsVehG5^p3}<9n9VeGBNXvnjo@0lY zcU?F^gL#H;vBo`vpvAbn@CubZR3+Lp?A0Be`{e zR1p;ajz^-nI3cVq1Vc{#oW1?K<*qc!2YiOs(8s~Do4_~N9s6c%v2?+6rrvKdEUZ zdThSY27ckTGE7FAP9KoNTPOsk&guF@h(FWebj(gHJ!RoiEZfUN)4`nLLBkXMJK+hv z#2L$N({UBQZZ1jDtEyZkEN>k?Jwr~Dhe_An{aT^!n#$gWr=*c-6dp+B0%nC;E6u;7 zq4>@jh5kH%C^-AmC3moA-?+W$yM)-IjrjqB#6Bpq)aa8i( ze@8~0lsOk($||^Pa+4-_N}v86XVJAc8k!vvyn7xRUmN9&)sx`G>&aorhu*gBP1QIg zOrET?)NHy_U5$4?4yjfY|FO zNu(&^9;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insertion(+), 1 deletion(-) diff --git a/src/server/index.js b/src/server/index.js index 818d6191ea49..787ab6ed2dbd 100755 --- a/src/server/index.js +++ b/src/server/index.js @@ -52,7 +52,7 @@ if (program.host) { } const app = express(); -app.use(favicon(__dirname + '/public/favicon.ico')); +app.use(favicon(path.resolve(__dirname, 'public/favicon.ico'))); if (program.staticDir) { program.staticDir = parseList(program.staticDir);