chore: use `lodash-es` to support vite (#2777)

To fix error: `Uncaught (in promise) SyntaxError: The requested module
'/@modules/lodash/isPlainObject.js' does not provide an export named
'default'`
pull/2784/head
Carter Li 2020-09-02 22:44:16 +08:00 committed by GitHub
parent 58b66daa1e
commit fb52b36067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 33 additions and 33 deletions

View File

@ -1,7 +1,7 @@
import interopDefault from './interopDefault'; import interopDefault from './interopDefault';
import moment from 'moment'; import moment from 'moment';
import warning from './warning'; import warning from './warning';
import isNil from 'lodash/isNil'; import isNil from 'lodash-es/isNil';
export const TimeType = { export const TimeType = {
validator(value) { validator(value) {

View File

@ -1,4 +1,4 @@
import isPlainObject from 'lodash/isPlainObject'; import isPlainObject from 'lodash-es/isPlainObject';
import classNames from './classNames'; import classNames from './classNames';
import { isVNode, Fragment, Comment, Text, h } from 'vue'; import { isVNode, Fragment, Comment, Text, h } from 'vue';
import { camelize, hyphenate, isOn, resolvePropValue } from './util'; import { camelize, hyphenate, isOn, resolvePropValue } from './util';

View File

@ -1,4 +1,4 @@
import isPlainObject from 'lodash/isPlainObject'; import isPlainObject from 'lodash-es/isPlainObject';
import { toType, getType, isFunction, validateType, isInteger, isArray, warn } from './utils'; import { toType, getType, isFunction, validateType, isInteger, isArray, warn } from './utils';
const VuePropTypes = { const VuePropTypes = {

View File

@ -1,4 +1,4 @@
import isPlainObject from 'lodash/isPlainObject'; import isPlainObject from 'lodash-es/isPlainObject';
const ObjProto = Object.prototype; const ObjProto = Object.prototype;
const toString = ObjProto.toString; const toString = ObjProto.toString;

View File

@ -6,7 +6,7 @@ import PropTypes from '../_util/vue-types';
import { getComponent, getSlot, isEmptyElement } from '../_util/props-util'; import { getComponent, getSlot, isEmptyElement } from '../_util/props-util';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import { ConfigConsumerProps } from '../config-provider'; import { ConfigConsumerProps } from '../config-provider';
import isPlainObject from 'lodash/isPlainObject'; import isPlainObject from 'lodash-es/isPlainObject';
const { TabPane } = Tabs; const { TabPane } = Tabs;
export default { export default {

View File

@ -1,6 +1,6 @@
import { inject } from 'vue'; import { inject } from 'vue';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import debounce from 'lodash/debounce'; import debounce from 'lodash-es/debounce';
import hasProp, { initDefaultProps, getComponent } from '../_util/props-util'; import hasProp, { initDefaultProps, getComponent } from '../_util/props-util';
import { ConfigConsumerProps } from '../config-provider'; import { ConfigConsumerProps } from '../config-provider';
import warning from '../_util/warning'; import warning from '../_util/warning';

View File

@ -5,7 +5,7 @@ import Pickr from '@simonwep/pickr/dist/pickr.es5.min';
import Icon from '../icon'; import Icon from '../icon';
import LocaleReceiver from '../locale-provider/LocaleReceiver'; import LocaleReceiver from '../locale-provider/LocaleReceiver';
import enUS from './locale/en_US'; import enUS from './locale/en_US';
import debounce from 'lodash/debounce'; import debounce from 'lodash-es/debounce';
import { getOptionProps, findDOMNode } from '../_util/props-util'; import { getOptionProps, findDOMNode } from '../_util/props-util';
let colors = '#194d33'; let colors = '#194d33';

View File

@ -1,6 +1,6 @@
import { inject } from 'vue'; import { inject } from 'vue';
import moment from 'moment'; import moment from 'moment';
import omit from 'lodash/omit'; import omit from 'lodash-es/omit';
import MonthCalendar from '../vc-calendar/src/MonthCalendar'; import MonthCalendar from '../vc-calendar/src/MonthCalendar';
import VcDatePicker from '../vc-calendar/src/Picker'; import VcDatePicker from '../vc-calendar/src/Picker';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';

View File

@ -2,7 +2,7 @@ import { inject, provide } from 'vue';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import { ColProps } from '../grid/Col'; import { ColProps } from '../grid/Col';
import isRegExp from 'lodash/isRegExp'; import isRegExp from 'lodash-es/isRegExp';
import warning from '../_util/warning'; import warning from '../_util/warning';
import FormItem from './FormItem'; import FormItem from './FormItem';
import { initDefaultProps, getSlot } from '../_util/props-util'; import { initDefaultProps, getSlot } from '../_util/props-util';
@ -11,7 +11,7 @@ import { getNamePath, containsNamePath } from './utils/valueUtil';
import { defaultValidateMessages } from './utils/messages'; import { defaultValidateMessages } from './utils/messages';
import { allPromiseFinish } from './utils/asyncUtil'; import { allPromiseFinish } from './utils/asyncUtil';
import { toArray } from './utils/typeUtil'; import { toArray } from './utils/typeUtil';
import isEqual from 'lodash/isEqual'; import isEqual from 'lodash-es/isEqual';
import scrollIntoView from 'scroll-into-view-if-needed'; import scrollIntoView from 'scroll-into-view-if-needed';
export const FormProps = { export const FormProps = {

View File

@ -1,5 +1,5 @@
import { inject, provide, Transition } from 'vue'; import { inject, provide, Transition } from 'vue';
import cloneDeep from 'lodash/cloneDeep'; import cloneDeep from 'lodash-es/cloneDeep';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import getTransitionProps from '../_util/getTransitionProps'; import getTransitionProps from '../_util/getTransitionProps';
@ -25,7 +25,7 @@ import { validateRules } from './utils/validateUtil';
import { getNamePath } from './utils/valueUtil'; import { getNamePath } from './utils/valueUtil';
import { toArray } from './utils/typeUtil'; import { toArray } from './utils/typeUtil';
import { warning } from '../vc-util/warning'; import { warning } from '../vc-util/warning';
import find from 'lodash/find'; import find from 'lodash-es/find';
const iconMap = { const iconMap = {
success: CheckCircleFilled, success: CheckCircleFilled,

View File

@ -10,7 +10,7 @@ import { cloneElement } from '../_util/vnode';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import { getOptionProps, getComponent } from '../_util/props-util'; import { getOptionProps, getComponent } from '../_util/props-util';
import { ConfigConsumerProps } from '../config-provider'; import { ConfigConsumerProps } from '../config-provider';
import isPlainObject from 'lodash/isPlainObject'; import isPlainObject from 'lodash-es/isPlainObject';
export default { export default {
name: 'AInputSearch', name: 'AInputSearch',

View File

@ -1,5 +1,5 @@
import { inject, cloneVNode, isVNode } from 'vue'; import { inject, cloneVNode, isVNode } from 'vue';
import debounce from 'lodash/debounce'; import debounce from 'lodash-es/debounce';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import { initDefaultProps, getComponent, getSlot } from '../_util/props-util'; import { initDefaultProps, getComponent, getSlot } from '../_util/props-util';

View File

@ -1,4 +1,4 @@
import padEnd from 'lodash/padEnd'; import padEnd from 'lodash-es/padEnd';
import { createVNode } from 'vue'; import { createVNode } from 'vue';
const Number = (_, { attrs }) => { const Number = (_, { attrs }) => {

View File

@ -1,5 +1,5 @@
import moment from 'moment'; import moment from 'moment';
import padStart from 'lodash/padStart'; import padStart from 'lodash-es/padStart';
import interopDefault from '../_util/interopDefault'; import interopDefault from '../_util/interopDefault';

View File

@ -1,6 +1,6 @@
import { inject } from 'vue'; import { inject } from 'vue';
import omit from 'omit.js'; import omit from 'omit.js';
import debounce from 'lodash/debounce'; import debounce from 'lodash-es/debounce';
import FolderOpenOutlined from '@ant-design/icons-vue/FolderOpenOutlined'; import FolderOpenOutlined from '@ant-design/icons-vue/FolderOpenOutlined';
import FolderOutlined from '@ant-design/icons-vue/FolderOutlined'; import FolderOutlined from '@ant-design/icons-vue/FolderOutlined';
import FileOutlined from '@ant-design/icons-vue/FileOutlined'; import FileOutlined from '@ant-design/icons-vue/FileOutlined';

View File

@ -1,6 +1,6 @@
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import uniqBy from 'lodash/uniqBy'; import uniqBy from 'lodash-es/uniqBy';
import findIndex from 'lodash/findIndex'; import findIndex from 'lodash-es/findIndex';
import VcUpload from '../vc-upload'; import VcUpload from '../vc-upload';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import { getOptionProps, initDefaultProps, hasProp, getSlot } from '../_util/props-util'; import { getOptionProps, initDefaultProps, hasProp, getSlot } from '../_util/props-util';

View File

@ -4,7 +4,7 @@ import { alignElement, alignPoint } from 'dom-align';
import addEventListener from '../vc-util/Dom/addEventListener'; import addEventListener from '../vc-util/Dom/addEventListener';
import { isWindow, buffer, isSamePoint, isSimilarValue, restoreFocus } from './util'; import { isWindow, buffer, isSamePoint, isSimilarValue, restoreFocus } from './util';
import { cloneElement } from '../_util/vnode.js'; import { cloneElement } from '../_util/vnode.js';
import clonedeep from 'lodash/cloneDeep'; import clonedeep from 'lodash-es/cloneDeep';
import { getSlot, findDOMNode } from '../_util/props-util'; import { getSlot, findDOMNode } from '../_util/props-util';
function getElement(func) { function getElement(func) {

View File

@ -7,7 +7,7 @@ import KeyCode from '../../_util/KeyCode';
import placements from './picker/placements'; import placements from './picker/placements';
import Trigger from '../../vc-trigger'; import Trigger from '../../vc-trigger';
import moment from 'moment'; import moment from 'moment';
import isNil from 'lodash/isNil'; import isNil from 'lodash-es/isNil';
const TimeType = { const TimeType = {
validator(value) { validator(value) {
if (Array.isArray(value)) { if (Array.isArray(value)) {

View File

@ -3,8 +3,8 @@ import BaseMixin from '../../_util/BaseMixin';
import addEventListener from '../../vc-util/Dom/addEventListener'; import addEventListener from '../../vc-util/Dom/addEventListener';
import { initDefaultProps, findDOMNode, getSlot } from '../../_util/props-util'; import { initDefaultProps, findDOMNode, getSlot } from '../../_util/props-util';
import warning from '../../_util/warning'; import warning from '../../_util/warning';
import debounce from 'lodash/debounce'; import debounce from 'lodash-es/debounce';
import throttle from 'lodash/throttle'; import throttle from 'lodash-es/throttle';
import parentScroll from './utils/parentScroll'; import parentScroll from './utils/parentScroll';
import inViewport from './utils/inViewport'; import inViewport from './utils/inViewport';
import { watchEffect } from 'vue'; import { watchEffect } from 'vue';

View File

@ -1,5 +1,5 @@
import isMobile from './utils/isMobile'; import isMobile from './utils/isMobile';
import isObject from 'lodash/isObject'; import isObject from 'lodash-es/isObject';
export function noop() {} export function noop() {}

View File

@ -1,4 +1,4 @@
import debounce from 'lodash/debounce'; import debounce from 'lodash-es/debounce';
import classnames from '../../_util/classNames'; import classnames from '../../_util/classNames';
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import defaultProps from './default-props'; import defaultProps from './default-props';

View File

@ -1,6 +1,6 @@
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import BaseMixin from '../_util/BaseMixin'; import BaseMixin from '../_util/BaseMixin';
import debounce from 'lodash/debounce'; import debounce from 'lodash-es/debounce';
import isFlexSupported from '../_util/isFlexSupported'; import isFlexSupported from '../_util/isFlexSupported';
import { filterEmpty, getSlot, getPropsData } from '../_util/props-util'; import { filterEmpty, getSlot, getPropsData } from '../_util/props-util';
import { cloneElement } from '../_util/vnode'; import { cloneElement } from '../_util/vnode';

View File

@ -1,7 +1,7 @@
/* eslint-disable camelcase */ /* eslint-disable camelcase */
import { provide, markRaw } from 'vue'; import { provide, markRaw } from 'vue';
import shallowequal from '../../_util/shallowequal'; import shallowequal from '../../_util/shallowequal';
import merge from 'lodash/merge'; import merge from 'lodash-es/merge';
import classes from 'component-classes'; import classes from 'component-classes';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import PropTypes from '../../_util/vue-types'; import PropTypes from '../../_util/vue-types';

View File

@ -1,6 +1,6 @@
import { inject } from 'vue'; import { inject } from 'vue';
import PropTypes from '../../_util/vue-types'; import PropTypes from '../../_util/vue-types';
import get from 'lodash/get'; import get from 'lodash-es/get';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import { isValidElement } from '../../_util/props-util'; import { isValidElement } from '../../_util/props-util';

View File

@ -1,4 +1,4 @@
import debounce from 'lodash/debounce'; import debounce from 'lodash-es/debounce';
import ResizeObserver from 'resize-observer-polyfill'; import ResizeObserver from 'resize-observer-polyfill';
import PropTypes from '../../_util/vue-types'; import PropTypes from '../../_util/vue-types';
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';

View File

@ -1,6 +1,6 @@
import PropTypes from '../../_util/vue-types'; import PropTypes from '../../_util/vue-types';
import BaseMixin from '../../_util/BaseMixin'; import BaseMixin from '../../_util/BaseMixin';
import partition from 'lodash/partition'; import partition from 'lodash-es/partition';
import classNames from '../../_util/classNames'; import classNames from '../../_util/classNames';
import defaultRequest from './request'; import defaultRequest from './request';
import getUid from './uid'; import getUid from './uid';

View File

@ -57,8 +57,8 @@
}, },
"homepage": "https://www.antdv.com/", "homepage": "https://www.antdv.com/",
"peerDependencies": { "peerDependencies": {
"vue": ">=3.0.0", "@vue/compiler-sfc": ">=3.0.0",
"@vue/compiler-sfc": ">=3.0.0" "vue": ">=3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@ant-design-vue/babel-plugin-jsx": "^1.0.0-rc.1", "@ant-design-vue/babel-plugin-jsx": "^1.0.0-rc.1",
@ -200,7 +200,7 @@
"is-negative-zero": "^2.0.0", "is-negative-zero": "^2.0.0",
"ismobilejs": "^1.0.0", "ismobilejs": "^1.0.0",
"json2mq": "^0.2.0", "json2mq": "^0.2.0",
"lodash": "^4.17.5", "lodash-es": "^4.17.15",
"moment": "^2.27.0", "moment": "^2.27.0",
"node-emoji": "^1.10.0", "node-emoji": "^1.10.0",
"omit.js": "^2.0.0", "omit.js": "^2.0.0",