Skip to content

Commit 67a5323

Browse files
authored
fix(babel): keep function names to improve stack traces in tests (#189)
* fix(babel): keep function names to improve stack traces in tests Fixes #188 * fix(babel): remove minify babel plugin if minify env variable is false
1 parent 2e7e312 commit 67a5323

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/config/babelrc.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const isRollup = parseEnv('BUILD_ROLLUP', false)
1717
const isUMD = BUILD_FORMAT === 'umd'
1818
const isCJS = BUILD_FORMAT === 'cjs'
1919
const isWebpack = parseEnv('BUILD_WEBPACK', false)
20+
const isMinify = parseEnv('BUILD_MINIFY', false)
2021
const treeshake = parseEnv('BUILD_TREESHAKE', isRollup || isWebpack)
2122
const alias = parseEnv('BUILD_ALIAS', isPreact ? {react: 'preact'} : null)
2223

@@ -81,7 +82,9 @@ module.exports = () => ({
8182
? require.resolve('babel-plugin-transform-inline-environment-variables')
8283
: null,
8384
[require.resolve('@babel/plugin-proposal-class-properties'), {loose: true}],
84-
require.resolve('babel-plugin-minify-dead-code-elimination'),
85+
isMinify
86+
? require.resolve('babel-plugin-minify-dead-code-elimination')
87+
: null,
8588
treeshake
8689
? null
8790
: require.resolve('@babel/plugin-transform-modules-commonjs'),

0 commit comments

Comments
 (0)