Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

是否可以支持组件库按需导入 #25

Open
xxyuze opened this issue May 17, 2019 · 1 comment
Open

是否可以支持组件库按需导入 #25

xxyuze opened this issue May 17, 2019 · 1 comment

Comments

@xxyuze
Copy link

xxyuze commented May 17, 2019

  • 许多时候只用得上vant的一部分组件,使用gulp可以选择部分组件导入,这样可以缩小生成的大小

gulp.task('vant', function () { gulp.src('./node_modules/vant-weapp/dist/{common,mixins,cell,cell-group,button,loading,field,tabs,tab,tag,icon,popup,overlay,transition}/**/*.{wxml,wxss,js,json}') .pipe(gulp.dest('dist/libs/vant')); })

@NewFuture
Copy link
Owner

嗯,这个需求确实存在,

但是似乎很难自动化实现

如果 把所有 .json 的 components 和 dependences 把依赖关系提取出来, 但是这个存在风险,组件库中也有依赖

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants