babel.config.js 728 Bytes
Newer Older
Julien Benchetrit's avatar
Julien Benchetrit committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
module.exports = {
  presets: [
    [
      '@babel/preset-env',
      {
        modules: false,
      },
    ],
    '@babel/preset-react',
  ],
  plugins: [
    'styled-components',
    '@babel/plugin-proposal-class-properties',
    '@babel/plugin-syntax-dynamic-import',
张烨's avatar
张烨 committed
15
    ['import', { libraryName: 'antd', style: true }],
Julien Benchetrit's avatar
Julien Benchetrit committed
16 17 18
  ],
  env: {
    production: {
dengxiaofeng's avatar
dengxiaofeng committed
19
      only: ['src'],
Julien Benchetrit's avatar
Julien Benchetrit committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
      plugins: [
        'lodash',
        'transform-react-remove-prop-types',
        '@babel/plugin-transform-react-inline-elements',
        '@babel/plugin-transform-react-constant-elements',
      ],
    },
    test: {
      plugins: [
        '@babel/plugin-transform-modules-commonjs',
        'dynamic-import-node',
      ],
    },
  },
};