const path =require('path')
export default {
  entry: {
    index: './src/index.js',
    opt: ['@woowalker/feui'],
    react: ['react'],
    reactdom: ['react-dom'],
    reactrouter: ['react-router'],
    reactdnd: ['react-dnd', 'react-dnd-html5-backend'],
    reactemeditor: ['react-umeditor'],
    moment: ['moment'],
    lodash: ['lodash'],
    draft: ['draft-js'],
    printjs: ['print-js'],
    qrcode: ['qrcode'],
    echarts: ['echarts', 'echarts-for-react'],
    bizcharts: ['bizcharts'],
    xlsx: ['xlsx'],
    canvg: ['canvg'],
    g2: ['g2', 'g2-react'],
    html2canvas: ['html2canvas'],
    antdlib: ['antd/lib'],
    antdes: ['antd/es'],
    antdicons: ['@ant-design/icons/lib'],
    antdtable: ['antd/es/table'],
    antdupload: ['antd/es/upload'],
    antdcascader: ['antd/es/cascader'],
    antdtabs: ['antd/es/tabs'],
    antdform: ['antd/es/form'],
    antddrawer: ['antd/es/drawer'],
    antdtypography: ['antd/es/typography'],
    antdpagination: ['antd/es/pagination'],
    antdinput: ['antd/es/input'],
    antdinputnumber: ['antd/es/input-number'],
    antdslider: ['antd/es/slider'],
  },
  alias: {
    '@woowalker/feui': path.resolve(__dirname, 'src/feui')
  },
  es5ImcompatibleVersions: true,
  env: {
    development: {
      extraBabelPlugins: [
        ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]
      ]
    },
    production: {
      extraBabelPlugins: [
        ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]
      ]
    }
  },
  hash: true,
  html: {
    template: './public/index.ejs'
  },
  commons: [
    {
      names: [
        'opt',
        'react',
        'reactdom',
        'reactrouter',
        'reactdnd',
        'reactemeditor',
        'moment',
        'lodash',
        'draft',
        'printjs',
        'qrcode',
        'echarts',
        'bizcharts',
        'xlsx',
        'canvg',
        'g2',
        'html2canvas',
        'antdlib',
        'antdes',
        'antdicons',
        'antdtable',
        'antdupload',
        'antdcascader',
        'antdtabs',
        'antdform',
        'antddrawer',
        'antdtypography',
        'antdpagination',
        'antdinput',
        'antdinputnumber',
        'antdslider',
      ],
      minChunks: Infinity
    }
  ]
}
