diff --git a/dist/server/build.js b/dist/server/build.js index 0c892edb1249..5e158c9f22d1 100644 --- a/dist/server/build.js +++ b/dist/server/build.js @@ -59,7 +59,7 @@ _shelljs2.default.mkdir('-p', _path2.default.resolve(outputDir, 'static')); // Build the webpack configuration using the `baseConfig` // custom `.babelrc` file and `webpack.config.js` files var configDir = _commander2.default.configDir || './.storybook'; -var config = (0, _config2.default)(_webpackConfig2.default, configDir); +var config = (0, _config2.default)('PRODUCTION', _webpackConfig2.default, configDir); // Write both the storybook UI and IFRAME HTML files to destination path. var headHtml = (0, _utils.getHeadHtml)(configDir); diff --git a/dist/server/config.js b/dist/server/config.js index 1ba90f34e6e7..e317bdaef982 100644 --- a/dist/server/config.js +++ b/dist/server/config.js @@ -12,7 +12,7 @@ var _extends2 = require('babel-runtime/helpers/extends'); var _extends3 = _interopRequireDefault(_extends2); -exports.default = function (baseConfig, configDir) { +exports.default = function (configType, baseConfig, configDir) { var config = baseConfig; // search for a .babelrc in the config directory, then the module root directory @@ -56,7 +56,7 @@ exports.default = function (baseConfig, configDir) { if (typeof customConfig === 'function') { logger.info('=> Loading custom webpack config (full-control mode).'); - return customConfig(config); + return customConfig(config, configType); } logger.info('=> Loading custom webpack config.'); diff --git a/dist/server/index.js b/dist/server/index.js index 214eb8ae75bf..b4cd20198418 100755 --- a/dist/server/index.js +++ b/dist/server/index.js @@ -81,7 +81,7 @@ if (_commander2.default.staticDir) { // Build the webpack configuration using the `baseConfig` // custom `.babelrc` file and `webpack.config.js` files var configDir = _commander2.default.configDir || './.storybook'; -var config = (0, _config2.default)(_webpack4.default, configDir); +var config = (0, _config2.default)('DEVELOPMENT', _webpack4.default, configDir); var compiler = (0, _webpack2.default)(config); var devMiddlewareOptions = { diff --git a/src/server/build.js b/src/server/build.js index a09fbabf9358..2c73e62dc0ac 100644 --- a/src/server/build.js +++ b/src/server/build.js @@ -31,7 +31,7 @@ shelljs.mkdir('-p', path.resolve(outputDir, 'static')); // Build the webpack configuration using the `baseConfig` // custom `.babelrc` file and `webpack.config.js` files const configDir = program.configDir || './.storybook'; -const config = loadConfig(baseConfig, configDir); +const config = loadConfig('PRODUCTION', baseConfig, configDir); // Write both the storybook UI and IFRAME HTML files to destination path. const headHtml = getHeadHtml(configDir); diff --git a/src/server/config.js b/src/server/config.js index f5b26cc6c5e2..77d03803429d 100644 --- a/src/server/config.js +++ b/src/server/config.js @@ -25,7 +25,7 @@ function loadBabelConfig(babelConfigPath) { // `baseConfig` is a webpack configuration bundled with storybook. // React Storybook will look in the `configDir` directory // (inside working directory) if a config path is not provided. -export default function (baseConfig, configDir) { +export default function (configType, baseConfig, configDir) { const config = baseConfig; // search for a .babelrc in the config directory, then the module root directory @@ -69,7 +69,7 @@ export default function (baseConfig, configDir) { if (typeof customConfig === 'function') { logger.info('=> Loading custom webpack config (full-control mode).'); - return customConfig(config); + return customConfig(config, configType); } logger.info('=> Loading custom webpack config.'); diff --git a/src/server/index.js b/src/server/index.js index 59862615138a..981ee53d11cc 100755 --- a/src/server/index.js +++ b/src/server/index.js @@ -47,7 +47,7 @@ if (program.staticDir) { // Build the webpack configuration using the `baseConfig` // custom `.babelrc` file and `webpack.config.js` files const configDir = program.configDir || './.storybook'; -const config = loadConfig(baseConfig, configDir); +const config = loadConfig('DEVELOPMENT', baseConfig, configDir); const compiler = webpack(config); const devMiddlewareOptions = {