Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions dist/manager.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/manager.js.map

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/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)());
_fs2.default.writeFileSync(_path2.default.resolve(outputDir, 'iframe.html'), (0, _iframe2.default)(headHtml));
_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));

// 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) {
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 ";
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 ";
};
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)());
res.send((0, _index2.default)(config.output.publicPath));
});

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

return router;
Expand Down
5 changes: 3 additions & 2 deletions src/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ 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());
fs.writeFileSync(path.resolve(outputDir, 'iframe.html'), getIframeHtml(headHtml));
fs.writeFileSync(path.resolve(outputDir, 'index.html'), getIndexHtml(config.output.publicPath));
fs.writeFileSync(path.resolve(outputDir, 'iframe.html'),
getIframeHtml(headHtml, config.output.publicPath));

// 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) {
export default function (headHtml, publicPath) {
return `
<!DOCTYPE html>
<html>
Expand All @@ -15,7 +15,7 @@ export default function (headHtml) {
</head>
<body>
<div id="root"></div>
<script src="static/preview.bundle.js"></script>
<script src="${publicPath}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 () {
export default function (publicPath) {
return `
<!DOCTYPE html>
<html>
Expand Down Expand Up @@ -38,7 +38,7 @@ export default function () {
</head>
<body style="margin: 0;">
<div id="root"></div>
<script src="static/manager.bundle.js"></script>
<script src="${publicPath}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());
res.send(getIndexHtml(config.output.publicPath));
});

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

return router;
Expand Down