Skip to content

Commit

Permalink
Allow full control over webpack config.
Browse files Browse the repository at this point in the history
If a function is returned from the '.storybook/webpack.config.js' then it will kick in 'full-control mode'. The function accepts the baseConfig from storybook and the dev can modify it with full control. This is necessary for more custom webpack configurations.
  • Loading branch information
Tim Kindberg committed May 3, 2016
1 parent 8d7d6da commit 289f5e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dist/server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ exports.default = function (baseConfig, configDir) {
}

var customConfig = require(customConfigPath);

if (typeof customConfig === 'function') {
logger.info('=> Loading custom webpack config (full-control mode).');
return customConfig(config);
}

logger.info('=> Loading custom webpack config.');

return (0, _extends3.default)({}, customConfig, config, {
Expand Down
6 changes: 6 additions & 0 deletions src/server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ export default function (baseConfig, configDir) {
}

const customConfig = require(customConfigPath);

if (typeof customConfig === 'function') {
logger.info('=> Loading custom webpack config (full-control mode).');
return customConfig(config);
}

logger.info('=> Loading custom webpack config.');

return {
Expand Down

0 comments on commit 289f5e1

Please sign in to comment.