Skip to content

Commit

Permalink
Revert PR #226
Browse files Browse the repository at this point in the history
  • Loading branch information
thani-sh committed Jun 6, 2016
1 parent 197f466 commit 047a957
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions dist/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ var config = (0, _config2.default)('PRODUCTION', _webpackConfig2.default, config

// Write both the storybook UI and IFRAME HTML files to destination path.
var headHtml = (0, _utils.getHeadHtml)(configDir);
_fs2.default.writeFileSync(_path2.default.resolve(outputDir, 'index.html'), (0, _index2.default)(config.output.publicPath));
_fs2.default.writeFileSync(_path2.default.resolve(outputDir, 'iframe.html'), (0, _iframe2.default)(headHtml, config.output.publicPath));
_fs2.default.writeFileSync(_path2.default.resolve(outputDir, 'index.html'), (0, _index2.default)());
_fs2.default.writeFileSync(_path2.default.resolve(outputDir, 'iframe.html'), (0, _iframe2.default)(headHtml));

// copy all static files
if (_commander2.default.staticDir) {
Expand Down
4 changes: 2 additions & 2 deletions dist/server/iframe.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
value: true
});

exports.default = function (headHtml, publicPath) {
return "\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <script>\n if (window.parent !== window) {\n window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n }\n </script>\n <title>React Storybook</title>\n " + headHtml + "\n </head>\n <body>\n <div id=\"root\"></div>\n <script src=\"" + publicPath + "preview.bundle.js\"></script>\n </body>\n </html>\n ";
exports.default = function (headHtml) {
return "\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <script>\n if (window.parent !== window) {\n window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n }\n </script>\n <title>React Storybook</title>\n " + headHtml + "\n </head>\n <body>\n <div id=\"root\"></div>\n <script src=\"static/preview.bundle.js\"></script>\n </body>\n </html>\n ";
};
4 changes: 2 additions & 2 deletions dist/server/index.html.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/server/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ exports.default = function (configDir) {
router.use((0, _webpackHotMiddleware2.default)(compiler));

router.get('/', function (req, res) {
res.send((0, _index2.default)(config.output.publicPath));
res.send((0, _index2.default)());
});

var headHtml = (0, _utils.getHeadHtml)(configDir);
router.get('/iframe.html', function (req, res) {
res.send((0, _iframe2.default)(headHtml, config.output.publicPath));
res.send((0, _iframe2.default)(headHtml));
});

return router;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kadira/storybook",
"version": "1.28.2",
"version": "1.28.1",
"description": "React Storybook: Isolate React Component Development with Hot Reloading.",
"repository": {
"type": "git",
Expand Down
5 changes: 2 additions & 3 deletions src/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ const config = loadConfig('PRODUCTION', baseConfig, configDir);

// Write both the storybook UI and IFRAME HTML files to destination path.
const headHtml = getHeadHtml(configDir);
fs.writeFileSync(path.resolve(outputDir, 'index.html'), getIndexHtml(config.output.publicPath));
fs.writeFileSync(path.resolve(outputDir, 'iframe.html'),
getIframeHtml(headHtml, config.output.publicPath));
fs.writeFileSync(path.resolve(outputDir, 'index.html'), getIndexHtml());
fs.writeFileSync(path.resolve(outputDir, 'iframe.html'), getIframeHtml(headHtml));

// copy all static files
if (program.staticDir) {
Expand Down
4 changes: 2 additions & 2 deletions src/server/iframe.html.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function (headHtml, publicPath) {
export default function (headHtml) {
return `
<!DOCTYPE html>
<html>
Expand All @@ -15,7 +15,7 @@ export default function (headHtml, publicPath) {
</head>
<body>
<div id="root"></div>
<script src="${publicPath}preview.bundle.js"></script>
<script src="static/preview.bundle.js"></script>
</body>
</html>
`;
Expand Down
4 changes: 2 additions & 2 deletions src/server/index.html.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function (publicPath) {
export default function () {
return `
<!DOCTYPE html>
<html>
Expand Down Expand Up @@ -38,7 +38,7 @@ export default function (publicPath) {
</head>
<body style="margin: 0;">
<div id="root"></div>
<script src="${publicPath}manager.bundle.js"></script>
<script src="static/manager.bundle.js"></script>
</body>
</html>
`;
Expand Down
4 changes: 2 additions & 2 deletions src/server/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ export default function (configDir) {
router.use(webpackHotMiddleware(compiler));

router.get('/', function (req, res) {
res.send(getIndexHtml(config.output.publicPath));
res.send(getIndexHtml());
});

const headHtml = getHeadHtml(configDir);
router.get('/iframe.html', function (req, res) {
res.send(getIframeHtml(headHtml, config.output.publicPath));
res.send(getIframeHtml(headHtml));
});

return router;
Expand Down

0 comments on commit 047a957

Please sign in to comment.