Skip to content

Commit

Permalink
Add node_modules as a excludePath for js. (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoda authored Aug 5, 2016
1 parent 154b9a8 commit e8efb3f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/server/config/defaults/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?$/,
Expand Down
6 changes: 4 additions & 2 deletions dist/server/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.includePaths = undefined;
exports.excludePaths = exports.includePaths = undefined;

var _path = require('path');

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')];
var includePaths = exports.includePaths = [_path2.default.resolve('./')];

var excludePaths = exports.excludePaths = [_path2.default.resolve('./node_modules')];
3 changes: 2 additions & 1 deletion dist/server/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ var config = {
test: /\.jsx?$/,
loader: 'babel',
query: require('./babel.js'),
include: _paths.includePaths
include: _paths.includePaths,
exclude: _paths.excludePaths
}]
}
};
Expand Down
3 changes: 2 additions & 1 deletion dist/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ var config = {
test: /\.jsx?$/,
loader: 'babel',
query: require('./babel.prod.js'),
include: _paths.includePaths
include: _paths.includePaths,
exclude: _paths.excludePaths
}]
}
};
Expand Down
5 changes: 4 additions & 1 deletion src/server/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
];
3 changes: 2 additions & 1 deletion src/server/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down Expand Up @@ -31,6 +31,7 @@ const config = {
loader: 'babel',
query: require('./babel.js'),
include: includePaths,
exclude: excludePaths,
},
],
},
Expand Down
3 changes: 2 additions & 1 deletion src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import webpack from 'webpack';
import { includePaths } from './paths';
import { includePaths, excludePaths } from './paths';

const entries = {
preview: [],
Expand Down Expand Up @@ -42,6 +42,7 @@ const config = {
loader: 'babel',
query: require('./babel.prod.js'),
include: includePaths,
exclude: excludePaths,
},
],
},
Expand Down

0 comments on commit e8efb3f

Please sign in to comment.