const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)

const plugins = []
if (IS_PROD) {
  // 在生产环境去掉console打印
  plugins.push('transform-remove-console')
}

module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset',
    ['@vue/babel-preset-jsx', { injectH: false }]
  ],
  plugins,
  env: {
    test: {
      presets: ['@babel/preset-env'],
      plugins: ['istanbul']
    }
  }
}
