Skip to content

Commit

Permalink
Merge pull request #473 from kadirahq/serve-favicon
Browse files Browse the repository at this point in the history
Serve the storybook favicon
  • Loading branch information
Muhammed Thanish committed Sep 21, 2016
2 parents d522476 + cf28a34 commit 53df979
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions scripts/prepublish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions src/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const outputDir = program.outputDir || './storybook-static';
// 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);

// The addon database service is disabled by default for now
// It should be enabled with the --enable-db for dev server
Expand Down
2 changes: 2 additions & 0 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -51,6 +52,7 @@ if (program.host) {
}

const app = express();
app.use(favicon(path.resolve(__dirname, 'public/favicon.ico')));

if (program.staticDir) {
program.staticDir = parseList(program.staticDir);
Expand Down
Binary file added src/server/public/favicon.ico
Binary file not shown.

0 comments on commit 53df979

Please sign in to comment.