Skip to content

Commit

Permalink
Merge pull request #1713 from storybooks/fix/1709-cacheDirectory
Browse files Browse the repository at this point in the history
FIX #1709
  • Loading branch information
ndelangen authored Aug 23, 2017
2 parents c291483 + d0b5176 commit 5ee5038
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 0 additions & 3 deletions app/react/src/server/config/babel.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const findCacheDir = require('find-cache-dir');

module.exports = {
// Don't try to find .babelrc because we want to force this configuration.
babelrc: false,
cacheDirectory: findCacheDir({ name: 'react-storybook' }),
presets: [
[
require.resolve('babel-preset-env'),
Expand Down
9 changes: 8 additions & 1 deletion app/vue/src/server/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable global-require, import/no-dynamic-require */
import fs from 'fs';
import path from 'path';
import findCacheDir from 'find-cache-dir';
import loadBabelConfig from './babel_config';

// avoid ESLint errors
Expand All @@ -13,7 +14,13 @@ export default function(configType, baseConfig, configDir) {
const config = baseConfig;

const babelConfig = loadBabelConfig(configDir);
config.module.rules[0].query = babelConfig;
config.module.rules[0].query = {
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables a cache directory for faster-rebuilds
// `find-cache-dir` will create the cache directory under the node_modules directory.
cacheDirectory: findCacheDir({ name: 'react-storybook' }),
...babelConfig,
};

// Check whether a config.js file exists inside the storybook
// config directory and throw an error if it's not.
Expand Down
3 changes: 0 additions & 3 deletions app/vue/src/server/config/babel.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const findCacheDir = require('find-cache-dir');

module.exports = {
// Don't try to find .babelrc because we want to force this configuration.
babelrc: false,
cacheDirectory: findCacheDir({ name: 'react-storybook' }),
presets: [
[
require.resolve('babel-preset-env'),
Expand Down

0 comments on commit 5ee5038

Please sign in to comment.