ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.13k stars 14.63k forks source link

[bug report] introduces some components, but the final result of webpack packaging is that the entire library is introduced, and tree shaping is invalid #19805

Open mingtianyihou33 opened 4 years ago

mingtianyihou33 commented 4 years ago

Element UI version

2.13.2

OS/Browsers version

macOS

Vue version

3.0.0-beta.19

Reproduction Link

https://jsfiddle.net/mmx38qxw/

Steps to reproduce

引入某个组件,直接看打包的bundle即可

What is Expected?

package.json 中应该添加module字段,导出es模块

What is actually happening?

"main": "lib/element-ui.common.js"。这个配置根本就没办法做tree shaking吧,这导致了引入部分组件,但是项目打包后体积很大。

element-bot commented 4 years ago

Translation of this issue:

Element UI version

2.13.2

OS/Browsers version

macOS

Vue version

3.0.0-beta.19

Reproduction Link

https://jsfiddle.net/mmx38qxw/

Steps to reproduce

Introduce a component and look directly at the packaged bundle

What is Expected?

package.json Module field should be added to export es module

What is actually happening?

"main": "lib/element- ui.common.js "。 There is no way to do tree shaping in this configuration, which leads to the introduction of some components, but the volume of the project after packaging is very large.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.