Skip to content

Commit

Permalink
fix(babel): remove minify babel plugin if minify env variable is false
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeyper committed Jan 10, 2021
1 parent ef59884 commit 57fa2d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/config/babelrc.js
Expand Up @@ -17,6 +17,7 @@ const isRollup = parseEnv('BUILD_ROLLUP', false)
const isUMD = BUILD_FORMAT === 'umd'
const isCJS = BUILD_FORMAT === 'cjs'
const isWebpack = parseEnv('BUILD_WEBPACK', false)
const isMinify = parseEnv('BUILD_MINIFY', false)
const treeshake = parseEnv('BUILD_TREESHAKE', isRollup || isWebpack)
const alias = parseEnv('BUILD_ALIAS', isPreact ? {react: 'preact'} : null)

Expand Down Expand Up @@ -81,7 +82,9 @@ module.exports = () => ({
? require.resolve('babel-plugin-transform-inline-environment-variables')
: null,
[require.resolve('@babel/plugin-proposal-class-properties'), {loose: true}],
['babel-plugin-minify-dead-code-elimination', {keepFnName: isTest}],
isMinify
? require.resolve('babel-plugin-minify-dead-code-elimination')
: null,
treeshake
? null
: require.resolve('@babel/plugin-transform-modules-commonjs'),
Expand Down

0 comments on commit 57fa2d2

Please sign in to comment.