diff --git a/dist/server/config/defaults/webpack.config.js b/dist/server/config/defaults/webpack.config.js index dd600c3ee6af..ce08fe820892 100644 --- a/dist/server/config/defaults/webpack.config.js +++ b/dist/server/config/defaults/webpack.config.js @@ -13,7 +13,7 @@ var _paths = require('../paths'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Add a default custom config which is similar to what React Create App does. -module.exports = function (storybookBaseConfig, configType) { +module.exports = function (storybookBaseConfig) { var newConfig = storybookBaseConfig; newConfig.module.loaders = [].concat((0, _toConsumableArray3.default)(newConfig.module.loaders), [{ test: /\.css?$/, diff --git a/dist/server/config/paths.js b/dist/server/config/paths.js index 078618c43d1b..7d6dfa2232f9 100644 --- a/dist/server/config/paths.js +++ b/dist/server/config/paths.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.includePaths = undefined; +exports.excludePaths = exports.includePaths = undefined; var _path = require('path'); @@ -11,4 +11,6 @@ var _path2 = _interopRequireDefault(_path); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var includePaths = exports.includePaths = [_path2.default.resolve('./'), __dirname, _path2.default.resolve(__dirname, '../../../src')]; \ No newline at end of file +var includePaths = exports.includePaths = [_path2.default.resolve('./')]; + +var excludePaths = exports.excludePaths = [_path2.default.resolve('./node_modules')]; \ No newline at end of file diff --git a/dist/server/config/webpack.config.js b/dist/server/config/webpack.config.js index 8cc17555f678..9f8c6eca9171 100644 --- a/dist/server/config/webpack.config.js +++ b/dist/server/config/webpack.config.js @@ -37,7 +37,8 @@ var config = { test: /\.jsx?$/, loader: 'babel', query: require('./babel.js'), - include: _paths.includePaths + include: _paths.includePaths, + exclude: _paths.excludePaths }] } }; diff --git a/dist/server/config/webpack.config.prod.js b/dist/server/config/webpack.config.prod.js index 7d1d72e253fa..ef31796b98da 100644 --- a/dist/server/config/webpack.config.prod.js +++ b/dist/server/config/webpack.config.prod.js @@ -47,7 +47,8 @@ var config = { test: /\.jsx?$/, loader: 'babel', query: require('./babel.prod.js'), - include: _paths.includePaths + include: _paths.includePaths, + exclude: _paths.excludePaths }] } }; diff --git a/src/server/config/paths.js b/src/server/config/paths.js index 30936e2f2707..9720f69f4456 100644 --- a/src/server/config/paths.js +++ b/src/server/config/paths.js @@ -2,5 +2,8 @@ import path from 'path'; export const includePaths = [ path.resolve('./'), - __dirname, path.resolve(__dirname, '../../../src'), +]; + +export const excludePaths = [ + path.resolve('./node_modules'), ]; diff --git a/src/server/config/webpack.config.js b/src/server/config/webpack.config.js index efd251ae809b..505f95032131 100644 --- a/src/server/config/webpack.config.js +++ b/src/server/config/webpack.config.js @@ -1,6 +1,6 @@ import path from 'path'; import webpack from 'webpack'; -import { includePaths } from './paths'; +import { includePaths, excludePaths } from './paths'; import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin'; const config = { @@ -31,6 +31,7 @@ const config = { loader: 'babel', query: require('./babel.js'), include: includePaths, + exclude: excludePaths, }, ], }, diff --git a/src/server/config/webpack.config.prod.js b/src/server/config/webpack.config.prod.js index 806b361646e2..dd195ae2c124 100644 --- a/src/server/config/webpack.config.prod.js +++ b/src/server/config/webpack.config.prod.js @@ -1,6 +1,6 @@ import path from 'path'; import webpack from 'webpack'; -import { includePaths } from './paths'; +import { includePaths, excludePaths } from './paths'; const entries = { preview: [], @@ -42,6 +42,7 @@ const config = { loader: 'babel', query: require('./babel.prod.js'), include: includePaths, + exclude: excludePaths, }, ], },