Skip to content

Commit

Permalink
Remove the cacheDirectory option from babel config
Browse files Browse the repository at this point in the history
In storyshots, we are running babel directly, not through webpack, so we can't use this option, which applies to `babel-loader`. See https://github.com/storybooks/storybook/blob/master/app/react/src/server/config/babel.js#L15

#1254
  • Loading branch information
tmeasday committed Jun 23, 2017
1 parent bf6faea commit e1dfd2e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/storyshots/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ export default function testStorySnapshots(options = {}) {
if (isStorybook) {
storybook = require.requireActual('@storybook/react');
// eslint-disable-next-line
const loadBabelConfig = require('@storybook/react/dist/server/babel_config').default;
const loadBabelConfig = require('@storybook/react/dist/server/babel_config')
.default;
const configDirPath = path.resolve(options.configPath || '.storybook');
configPath = path.join(configDirPath, 'config.js');

const babelConfig = loadBabelConfig(configDirPath);
// We set this in the default babel config, but it is webpack-only
delete babelConfig.cacheDirectory;
const content = babel.transformFileSync(configPath, babelConfig).code;
const contextOpts = {
filename: configPath,
Expand Down

0 comments on commit e1dfd2e

Please sign in to comment.