.fatherrc.js 567 Bytes
Newer Older
田翔's avatar
田翔 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
const type = process.env.BUILD_TYPE;
let config = {};

if (type === 'lib') {
  config = {
    cjs: { type: 'babel', lazy: true },
    esm: false,
    runtimeHelpers: true,
    extraBabelPlugins: [['babel-plugin-import', { libraryName: 'antd', libraryDirectory: 'lib', style: true }, 'antd']],
  };
}

if (type === 'es') {
  config = {
    cjs: false,
    esm: {
      type: 'babel',
    },
    runtimeHelpers: true,
    extraBabelPlugins: [['babel-plugin-import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd']],
  };
}

export default config;