There are some useless files in webpack package.

problem description

some JS appears in my webpack package, although it is not big, but it adds up to become very big. I don"t know where these things come from

related codes

this is the common component of my webpack packaged package.JSON vendor.JS
"dependencies": {

"antd": "^3.6.2",
"babel-polyfill": "^6.26.0",
"isomorphic-fetch": "^2.2.1",
"mobx": "^5.0.0",
"mobx-react": "^5.2.3",
"prop-types": "^15.6.1",
"query-string": "^6.1.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-router-dom": "^4.2.2", 
"spark-md5": "^3.0.0",
"video-react": "^0.11.2"

}

take a picture of the analysis after packing, it is easier to be obvious


these are used directly or indirectly in your project, there is no need to say .

for example, rc-calendar is a library that antd depends on.

for example, core-js is the content of babel-polyfill

and so on.


are all dependencies.
antd is not configured to introduce on demand


if you don't want to pack so many js in, you can consider external CDN references. That is, remove the related dependencies in the dependencies configuration and introduce js into

through the script tag of index.html.
Menu