From 90765302385ff303b8c3605d667fd8f2ab38d273 Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Mon, 30 Sep 2019 14:43:06 -0400 Subject: [PATCH] chore: fix node out of memory issues (#2712) --- babel.config.js | 7 +++++++ scripts/webpack.js | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 103880b6..cd9f7b18 100644 --- a/babel.config.js +++ b/babel.config.js @@ -102,6 +102,13 @@ const plugins = () => { if (isTest) { return [ ...defaultPlugins, + [ + 'emotion', + { + sourceMap: false, + autoLabel: false, + }, + ], [ 'inline-react-svg', { diff --git a/scripts/webpack.js b/scripts/webpack.js index 083060b9..d1f2fc8d 100644 --- a/scripts/webpack.js +++ b/scripts/webpack.js @@ -5,6 +5,7 @@ const { toGlobalName, externals } = require('./externals'); const pkg = require(path.join(process.cwd(), 'package.json')); const isProduction = process.env.NODE_ENV === 'production'; +const isTest = process.env.NODE_ENV === 'test'; const rules = () => ({ js: () => ({ @@ -111,7 +112,7 @@ const baseConfig = ({ target = isProduction ? 'umd' : 'umddir' } = {}) => ({ rules: Object.values(rules()).map(rule => rule()), }, plugins: Object.values(plugins()).map(plugin => plugin()), - devtool: 'source-map', + devtool: isTest ? '' : 'source-map', target: 'web', /**