diff --git a/packages/gatsby/src/utils/webpack.config.js b/packages/gatsby/src/utils/webpack.config.js index 788b40a22a58c..bbbe3c862fc04 100644 --- a/packages/gatsby/src/utils/webpack.config.js +++ b/packages/gatsby/src/utils/webpack.config.js @@ -372,7 +372,7 @@ module.exports = async ( // Common config for every env. config.loader(`js`, { test: /\.jsx?$/, // Accept either .js or .jsx files. - exclude: /(node_modules|bower_components)/, + exclude: [/(node_modules|bower_components)/], loader: `babel`, query: babelConfig, }) @@ -409,7 +409,7 @@ module.exports = async ( case `develop`: config.loader(`css`, { test: /\.css$/, - exclude: /\.module\.css$/, + exclude: [/\.module\.css$/], loaders: [`style`, `css`, `postcss`], }) @@ -434,7 +434,7 @@ module.exports = async ( case `build-css`: config.loader(`css`, { test: /\.css$/, - exclude: /\.module\.css$/, + exclude: [/\.module\.css$/], loader: ExtractTextPlugin.extract([`css?minimize`, `postcss`]), }) @@ -464,7 +464,7 @@ module.exports = async ( config.loader(`css`, { test: /\.css$/, - exclude: /\.module\.css$/, + exclude: [/\.module\.css$/], loader: `null`, }) @@ -489,7 +489,7 @@ module.exports = async ( config.loader(`css`, { test: /\.css$/, - exclude: /\.module\.css$/, + exclude: [/\.module\.css$/], // loader: `null`, loader: ExtractTextPlugin.extract([`css`]), })