{"action":"created","issue":{"url":"https://api.github.com/repos/ecomfe/echarts/issues/4935","repository_url":"https://api.github.com/repos/ecomfe/echarts","labels_url":"https://api.github.com/repos/ecomfe/echarts/issues/4935/labels{/name}","comments_url":"https://api.github.com/repos/ecomfe/echarts/issues/4935/comments","events_url":"https://api.github.com/repos/ecomfe/echarts/issues/4935/events","html_url":"https://github.com/ecomfe/echarts/issues/4935","id":200914583,"number":4935,"title":"使用webpack打包构建echarts，打包后的文件非常大，但只是引入了radar.js","user":{"login":"martinko2009","id":3345987,"avatar_url":"https://avatars0.githubusercontent.com/u/3345987?v=3","gravatar_id":"","url":"https://api.github.com/users/martinko2009","html_url":"https://github.com/martinko2009","followers_url":"https://api.github.com/users/martinko2009/followers","following_url":"https://api.github.com/users/martinko2009/following{/other_user}","gists_url":"https://api.github.com/users/martinko2009/gists{/gist_id}","starred_url":"https://api.github.com/users/martinko2009/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinko2009/subscriptions","organizations_url":"https://api.github.com/users/martinko2009/orgs","repos_url":"https://api.github.com/users/martinko2009/repos","events_url":"https://api.github.com/users/martinko2009/events{/privacy}","received_events_url":"https://api.github.com/users/martinko2009/received_events","type":"User","site_admin":false},"labels":[{"id":370414861,"url":"https://api.github.com/repos/ecomfe/echarts/labels/PENDING","name":"PENDING","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-01-16T01:47:38Z","updated_at":"2017-06-23T07:13:00Z","closed_at":null,"body":"<!--\r\n为了方便我们能够复现和修复 bug，请遵从下面的规范描述您的问题。\r\n-->\r\n\r\n\r\n### One-line summary [问题简述]\r\n我使用的是echarts 3.4.0版本。参考百度echarts官网例子，官网的例子如下：\r\n[在 webpack 中使用 ECharts](http://echarts.baidu.com/tutorial.html#%E5%9C%A8%20webpack%20%E4%B8%AD%E4%BD%BF%E7%94%A8%20ECharts)\r\n\r\n发现用webpack构建后，js文件没有像官网中说的那样，体积很小，而是有2.1兆，我只引入了部分组件，如下：\r\n\r\n```\r\nvar echarts = require('echarts/lib/echarts');\r\nrequire('echarts/lib/chart/radar');\r\nrequire('echarts/lib/component/tooltip');\r\nrequire('echarts/lib/component/title');\r\n```\r\n\r\n**这个页面是demo页面，只引入了echarts的组件，所以不会受到其他的组件的干扰。**\r\n\r\n\r\n### Version & Environment [版本及环境]\r\n+ ECharts version [ECharts 版本]: **echarts 3.4.0**\r\n+ Browser version [浏览器类型和版本]: **firefox 47, chrome 52**\r\n+ OS Version [操作系统类型和版本]: **win7**\r\n\r\n\r\n\r\n\r\n\r\n### Expected behaviour [期望结果]\r\n\r\n希望打完包后，体积如官网上所说的那样，体积变小。\r\n\r\n\r\n\r\n### ECharts option [ECharts配置项]\r\n<!-- Copy and paste your 'echarts option' here. -->\r\n<!-- [下方贴你的option，注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->\r\n```javascript\r\noption = {\r\n                color :['blue'],\r\n\t\ttitle : {\r\n\t\t\ttext:\"\"\r\n\t\t},\r\n\t\tbackgroundColor : null,\r\n\t\ttooltip : {\r\n\t\t\ttrigger: 'axis',\r\n\t\t\tformatter: function (params,ticket,callback) {\r\n\t\t\t\tvar index = params[0].dataIndex;\r\n\t\t\t\tvar showValue = params[0].data.show[index];\r\n\t\t\t\tvar res = params[0].name;\r\n\t\t\t\tvar name = params[0][\"3\"];\r\n\t\t\t\tres += '<br/>' + name + ' : ' + showValue;\r\n\t\t\t\tres = \"<div style='font-size:12px;word-break:break-all;word-wrap:break-word;white-space:normal'>\"+res+\"</div>\"\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t},\r\n\t\tnoDataLoadingOption: {\r\n                       text: '暂无数据',\r\n                       textStyle:{\r\n\t\t\t\t\t\t\tcolor:'#ffffff',\r\n\t\t\t\t\t\t\tfontSize:12,\r\n\t\t\t\t\t\t\tfontFamily : '微软雅黑'\r\n\t\t\t\t\t    },\r\n                        effect: 'bubble',\r\n                        effectOption: {\r\n\t\t\t\t\t\t\t backgroundColor:'#242730',\r\n                            effect: {\r\n                                n: 0\r\n                            }\r\n                        }\r\n                    },\r\n\t\tpolar : [\r\n\t\t   {\r\n\t\t\t   indicator : [],\r\n\t\t\t   radius : 100,\r\n\t\t\t   splitNumber : 3,\r\n\t\t\t   splitArea : {\r\n\t\t\t\t   show : true,\r\n\t\t\t\t   areaStyle : {\r\n\t\t\t\t\t   color: ['red','yellow','green']\r\n\t\t\t\t   }\r\n\t\t\t   },\r\n\t\t\t   name:{\r\n\t\t\t\t\ttextStyle:{\r\n\t\t\t\t\t\tcolor:\"#ffffff\"\r\n\t\t\t\t\t}\r\n\t\t\t   }\r\n\t\t\t}\r\n\t\t],\r\n\t\tcalculable : false,\r\n\t\tseries : [\r\n\t\t\t{\r\n\t\t\t\ttype: 'radar',\r\n\t\t\t\titemStyle: {\r\n\t\t\t\t\tnormal: {\r\n\t\t\t\t\t\tareaStyle: {\r\n\t\t\t\t\t\t\ttype: 'default'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdata : [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvalue : [],\r\n\t\t\t\t\t\tname : 'demo',\r\n\t\t\t\t\t\tid : [],\r\n\t\t\t\t\t\tshow : []\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t]\r\n}\r\n\r\n```\r\n\r\n\r\n\r\n\r\n### Other comments [其他信息]\r\n<!-- For example: Screenshot or Online demo -->\r\n<!-- [例如，截图或线上实例 (JSFiddle/JSBin/Codepen)] -->\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ecomfe/echarts/issues/comments/310590563","html_url":"https://github.com/ecomfe/echarts/issues/4935#issuecomment-310590563","issue_url":"https://api.github.com/repos/ecomfe/echarts/issues/4935","id":310590563,"user":{"login":"PorUnaCabeza","id":5096253,"avatar_url":"https://avatars0.githubusercontent.com/u/5096253?v=3","gravatar_id":"","url":"https://api.github.com/users/PorUnaCabeza","html_url":"https://github.com/PorUnaCabeza","followers_url":"https://api.github.com/users/PorUnaCabeza/followers","following_url":"https://api.github.com/users/PorUnaCabeza/following{/other_user}","gists_url":"https://api.github.com/users/PorUnaCabeza/gists{/gist_id}","starred_url":"https://api.github.com/users/PorUnaCabeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PorUnaCabeza/subscriptions","organizations_url":"https://api.github.com/users/PorUnaCabeza/orgs","repos_url":"https://api.github.com/users/PorUnaCabeza/repos","events_url":"https://api.github.com/users/PorUnaCabeza/events{/privacy}","received_events_url":"https://api.github.com/users/PorUnaCabeza/received_events","type":"User","site_admin":false},"created_at":"2017-06-23T07:13:00Z","updated_at":"2017-06-23T07:13:00Z","body":"+1"}}
{"actor":{"display_login":"PorUnaCabeza"}}