Browse Source
perf: optimize bundlesize (#20436)
* 📦 react-slick => @ant-design/react-slick
* 📦 Reduce non-minified dist files size
* 🆙 @ant-design/react-slick
pull/20451/head
偏右
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
5 additions and
4 deletions
-
components/carousel/index.tsx
-
package.json
-
webpack.config.js
|
|
@ -1,6 +1,6 @@ |
|
|
|
import * as React from 'react'; |
|
|
|
import debounce from 'lodash/debounce'; |
|
|
|
import { Settings } from 'react-slick'; |
|
|
|
import { Settings } from '@ant-design/react-slick'; |
|
|
|
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; |
|
|
|
import warning from '../_util/warning'; |
|
|
|
|
|
|
@ -8,7 +8,7 @@ import warning from '../_util/warning'; |
|
|
|
// make sure matchMedia polyfill run before require('react-slick')
|
|
|
|
// Fix https://github.com/ant-design/ant-design/issues/6560
|
|
|
|
// Fix https://github.com/ant-design/ant-design/issues/3308
|
|
|
|
const SlickCarousel = require('react-slick').default; |
|
|
|
const SlickCarousel = require('@ant-design/react-slick').default; |
|
|
|
|
|
|
|
export type CarouselEffect = 'scrollx' | 'fade'; |
|
|
|
export type DotPosition = 'top' | 'bottom' | 'left' | 'right'; |
|
|
|
|
|
@ -90,7 +90,6 @@ |
|
|
|
], |
|
|
|
"dependencies": { |
|
|
|
"@ant-design/icons": "^4.0.0-alpha.11", |
|
|
|
"@types/react-slick": "^0.23.4", |
|
|
|
"array-tree-filter": "^2.1.0", |
|
|
|
"classnames": "~2.2.6", |
|
|
|
"copy-to-clipboard": "^3.2.0", |
|
|
@ -131,7 +130,7 @@ |
|
|
|
"rc-upload": "~3.0.0-alpha.0", |
|
|
|
"rc-util": "~4.16.1", |
|
|
|
"rc-virtual-list": "^0.0.0-alpha.25", |
|
|
|
"react-slick": "~0.25.2", |
|
|
|
"@ant-design/react-slick": "~0.25.5", |
|
|
|
"resize-observer-polyfill": "^1.5.1", |
|
|
|
"scroll-into-view-if-needed": "^2.2.20", |
|
|
|
"shallowequal": "^1.1.0", |
|
|
|
|
|
@ -49,6 +49,8 @@ if (process.env.RUN_ENV === 'PRODUCTION') { |
|
|
|
externalMoment(config); |
|
|
|
addLocales(config); |
|
|
|
addDarkTheme(config); |
|
|
|
// Reduce non-minified dist files size
|
|
|
|
config.optimization.usedExports = true; |
|
|
|
// skip codesandbox ci
|
|
|
|
if (!process.env.CSB_REPO) { |
|
|
|
// https://docs.packtracker.io/uploading-your-webpack-stats/webpack-plugin
|
|
|
|