import path from 'path';
import { getInterpretedFile } from './interpret-files';

function loadConfigFiles({ configDir }) {
  const storybookConfigPath = getInterpretedFile(path.resolve(configDir, 'config'));
  const storybookPreviewPath = getInterpretedFile(path.resolve(configDir, 'preview'));

  return [].concat(storybookPreviewPath || storybookConfigPath || []);
}

export default loadConfigFiles;

import path from 'path';
import { getInterpretedFile } from './interpret-files';

function loadConfigFiles({ configDir }) {
  const storybookConfigPath = getInterpretedFile(path.resolve(configDir, 'config'));

  if (storybookConfigPath) {
    return [storybookConfigPath];
  }

  return [];
}

export default loadConfigFiles;

--- 
+++ 
@@ -3,12 +3,9 @@
 
 function loadConfigFiles({ configDir }) {
   const storybookConfigPath = getInterpretedFile(path.resolve(configDir, 'config'));
+  const storybookPreviewPath = getInterpretedFile(path.resolve(configDir, 'preview'));
 
-  if (storybookConfigPath) {
-    return [storybookConfigPath];
-  }
-
-  return [];
+  return [].concat(storybookPreviewPath || storybookConfigPath || []);
 }
 
 export default loadConfigFiles;
ADD support for preview.js as a replacement for config.js
