美文网首页react + dva + antd技术干货
roadhog2+如何配置commons提取公共组件,优化js文

roadhog2+如何配置commons提取公共组件,优化js文

作者: 61016b23b7d2 | 来源:发表于2019-05-06 00:10 被阅读0次

我这样配不行啊

.webpackrc.js中

export default{

  entry: {

    common: './src/vendor.js',

    antd: [

      'antd/lib/button',

      'antd/lib/icon',

      'antd/lib/table',

      'antd/lib/date-picker',

      'antd/lib/form',

      'antd/lib/modal',

      'antd/lib/grid',

      'antd/lib/input',

    ],

    index: "./src/index.js"

  },

  commons: [

    {

      names: ['antd','common'],

      children: true,

      minChunks:Infinity

    },

  ],

vendor.js中

import React from 'react'

import 'dva'

import moment from "moment"

import 'moment/locale/zh-cn'

moment.locale('zh-cn')

来个大佬教教我吧,跪求

相关文章

网友评论

    本文标题:roadhog2+如何配置commons提取公共组件,优化js文

    本文链接:https://www.haomeiwen.com/subject/qacloqtx.html