New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
现在用dva开发build出来的目标文件非常大(1.3M),不知如何缩小包的大小? #391
Labels
Comments
贴一下你的 |
@nikogu 下面是我的package.json
项目是我用 dvacli 创建的
|
echarts已经很大了 |
@codering echarts3 官网说的压缩后是170k多,如果能分离就好了,不知道有没有方法? |
可以按需引入对应的模块,比如只用 // ==== 以下必须引入 ====
// core
import echarts from 'echarts/lib/echarts'
// for ie8
//import 'zrender/lib/vml/vml'
// 柱状图
import 'echarts/lib/chart/bar'
// 折线图
import 'echarts/lib/chart/line'
// 饼图
import 'echarts/lib/chart/pie'
// ==== 以下不引入也可以,只是没效果,也不会报错 ====
// tooltip
import 'echarts/lib/component/tooltip'
// legend
import 'echarts/lib/component/legend'
// title
import 'echarts/lib/component/title'
echarts.init(...) 比较烦的是,这些模块并不是强依赖关系,会发现有些模块没引入就没效果,而有些模块会则在渲染时有错误提示,要求引入指定模块. 当然写个babel插件估计好处理些。。。。。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
您好!
我最近在使用dva做开发,很感谢dva作者们的努力~
目前我遇到的问题是,项目文件并不是很多,但是打包出来之后的package非常大(index.js 达到1.3MB了)。不知道dva构建能否支持将项目拆分成多个入口,按功能拆分页面呢?
The text was updated successfully, but these errors were encountered: