diff --git a/dist/server/build.js b/dist/server/build.js
old mode 100644
new mode 100755
index fa3c13dce825..2fb98c9b381f
--- a/dist/server/build.js
+++ b/dist/server/build.js
@@ -43,6 +43,10 @@ var _iframe2 = _interopRequireDefault(_iframe);
var _utils = require('./utils');
+var _uuid = require('uuid');
+
+var _uuid2 = _interopRequireDefault(_uuid);
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
@@ -91,11 +95,12 @@ if (_commander2.default.staticDir) {
});
}
+var cacheKey = _uuid2.default.v4();
// Write both the storybook UI and IFRAME HTML files to destination path.
var headHtml = (0, _utils.getHeadHtml)(configDir);
var publicPath = config.output.publicPath;
-_fs2.default.writeFileSync(_path2.default.resolve(outputDir, 'index.html'), (0, _index2.default)(publicPath));
-_fs2.default.writeFileSync(_path2.default.resolve(outputDir, 'iframe.html'), (0, _iframe2.default)(headHtml, publicPath));
+_fs2.default.writeFileSync(_path2.default.resolve(outputDir, 'index.html'), (0, _index2.default)(publicPath, cacheKey));
+_fs2.default.writeFileSync(_path2.default.resolve(outputDir, 'iframe.html'), (0, _iframe2.default)(headHtml, publicPath, cacheKey));
// compile all resources with webpack and write them to the disk.
logger.log('Building storybook ...');
diff --git a/dist/server/iframe.html.js b/dist/server/iframe.html.js
index 72976ccc493c..fec537009378 100644
--- a/dist/server/iframe.html.js
+++ b/dist/server/iframe.html.js
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-exports.default = function (headHtml, publicPath) {
- return '\n \n \n
\n \n \n \n React Storybook\n ' + headHtml + '\n \n \n \n \n \n \n \n ';
+exports.default = function (headHtml, publicPath, cacheKey) {
+ var previewUrl = cacheKey ? 'static/preview.bundle.js?' + cacheKey : 'static/preview.bundle.js';
+ return '\n \n \n \n \n \n \n React Storybook\n ' + headHtml + '\n \n \n \n \n \n \n \n ';
};
var _url = require('url');
diff --git a/dist/server/index.html.js b/dist/server/index.html.js
index d3e159491585..2a0bf35db346 100644
--- a/dist/server/index.html.js
+++ b/dist/server/index.html.js
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
-exports.default = function (publicPath) {
- return '\n \n \n \n \n \n React Storybook\n \n \n \n \n \n \n \n ';
+exports.default = function (publicPath, cacheKey) {
+ var managerUrl = cacheKey ? 'static/manager.bundle.js?' + cacheKey : 'static/manager.bundle.js';
+ return '\n \n \n \n \n \n React Storybook\n \n \n \n \n \n \n \n ';
};
var _url = require('url');
diff --git a/package.json b/package.json
index 839d968be597..0e7158e4d89c 100644
--- a/package.json
+++ b/package.json
@@ -57,7 +57,7 @@
"shelljs": "^0.7.4",
"style-loader": "0.13.1",
"url-loader": "^0.5.7",
- "uuid": "^2.0.2",
+ "uuid": "^2.0.3",
"webpack": "^1.13.1",
"webpack-dev-middleware": "^1.6.0",
"webpack-hot-middleware": "^2.10.0"
diff --git a/src/server/build.js b/src/server/build.js
index e4b6205d3e0d..3afc6c196fa1 100644
--- a/src/server/build.js
+++ b/src/server/build.js
@@ -5,6 +5,7 @@ import program from 'commander';
import path from 'path';
import fs from 'fs';
import shelljs from 'shelljs';
+import uuid from 'uuid';
import packageJson from '../../package.json';
import getBaseConfig from './config/webpack.config.prod';
import loadConfig from './config';
@@ -69,11 +70,12 @@ if (program.staticDir) {
});
}
+const cacheKey = uuid.v4();
// Write both the storybook UI and IFRAME HTML files to destination path.
const headHtml = getHeadHtml(configDir);
const publicPath = config.output.publicPath;
-fs.writeFileSync(path.resolve(outputDir, 'index.html'), getIndexHtml(publicPath));
-fs.writeFileSync(path.resolve(outputDir, 'iframe.html'), getIframeHtml(headHtml, publicPath));
+fs.writeFileSync(path.resolve(outputDir, 'index.html'), getIndexHtml(publicPath, cacheKey));
+fs.writeFileSync(path.resolve(outputDir, 'iframe.html'), getIframeHtml(headHtml, publicPath, cacheKey));
// compile all resources with webpack and write them to the disk.
logger.log('Building storybook ...');
diff --git a/src/server/iframe.html.js b/src/server/iframe.html.js
index 5d4b2b3ff3e5..7c0f01075c55 100644
--- a/src/server/iframe.html.js
+++ b/src/server/iframe.html.js
@@ -1,6 +1,7 @@
import url from 'url';
-export default function (headHtml, publicPath) {
+export default function (headHtml, publicPath, cacheKey) {
+ const previewUrl = cacheKey ? `static/preview.bundle.js?${cacheKey}` : 'static/preview.bundle.js';
return `
@@ -18,7 +19,7 @@ export default function (headHtml, publicPath) {
-
+
`;
diff --git a/src/server/index.html.js b/src/server/index.html.js
index 71a6eb0c1ff2..5e1d60d75143 100644
--- a/src/server/index.html.js
+++ b/src/server/index.html.js
@@ -1,6 +1,7 @@
import url from 'url';
-export default function (publicPath) {
+export default function (publicPath, cacheKey) {
+ const managerUrl = cacheKey ? `static/manager.bundle.js?${cacheKey}` : 'static/manager.bundle.js';
return `
@@ -40,7 +41,7 @@ export default function (publicPath) {
-
+