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', /**