{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vue-cli/issues/2330","repository_url":"https://api.github.com/repos/vuejs/vue-cli","labels_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2330/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2330/comments","events_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2330/events","html_url":"https://github.com/vuejs/vue-cli/issues/2330","id":353218737,"node_id":"MDU6SXNzdWUzNTMyMTg3Mzc=","number":2330,"title":"iview 按需引入 ie浏览器报语法错误；但是vue-cli2.0按同样规则没有问题","user":{"login":"qq986063761","id":18366007,"node_id":"MDQ6VXNlcjE4MzY2MDA3","avatar_url":"https://avatars0.githubusercontent.com/u/18366007?v=4","gravatar_id":"","url":"https://api.github.com/users/qq986063761","html_url":"https://github.com/qq986063761","followers_url":"https://api.github.com/users/qq986063761/followers","following_url":"https://api.github.com/users/qq986063761/following{/other_user}","gists_url":"https://api.github.com/users/qq986063761/gists{/gist_id}","starred_url":"https://api.github.com/users/qq986063761/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qq986063761/subscriptions","organizations_url":"https://api.github.com/users/qq986063761/orgs","repos_url":"https://api.github.com/users/qq986063761/repos","events_url":"https://api.github.com/users/qq986063761/events{/privacy}","received_events_url":"https://api.github.com/users/qq986063761/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-23T04:25:07Z","updated_at":"2018-08-23T06:42:35Z","closed_at":"2018-08-23T06:42:35Z","author_association":"NONE","body":"### Version\r\n3.0.1\r\n\r\n### Reproduction link\r\n[https://github.com/qq986063761/iview-demand-bug/tree/master](https://github.com/qq986063761/iview-demand-bug/tree/master)\r\n\r\n\r\n\r\n### Node and OS info\r\nnode版本8.9.1；npm版本6.2.0；windows 10；\r\n\r\n### Steps to reproduce\r\n1、下载重现链接中的仓库代码；\r\n2、安装默认依赖后执行npm run dev；\r\n3、使用谷歌浏览器和ie11浏览器分别访问本地链接；\r\n\r\n### What is expected?\r\n都能正常显示iview组件样式\r\n\r\n### What is actually happening?\r\n1、谷歌可以正常显示；\r\n2、ie（非edge，edge正常显示）无法正常显示报错语法错误；但是尝试以2.x方式在3.x脚手架中通过include.add追加iview/src目录到js rule规则中，但是还是语法报错，原因应该是es6语法兼容问题导致；\r\n\r\n---\r\n无业务场景，全新@vue/cli demo项目尝试；\r\n\r\n<!-- generated by vue-issues. DO NOT REMOVE -->"},"comment":{"url":"https://api.github.com/repos/vuejs/vue-cli/issues/comments/415309083","html_url":"https://github.com/vuejs/vue-cli/issues/2330#issuecomment-415309083","issue_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2330","id":415309083,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTMwOTA4Mw==","user":{"login":"sodatea","id":3277634,"node_id":"MDQ6VXNlcjMyNzc2MzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3277634?v=4","gravatar_id":"","url":"https://api.github.com/users/sodatea","html_url":"https://github.com/sodatea","followers_url":"https://api.github.com/users/sodatea/followers","following_url":"https://api.github.com/users/sodatea/following{/other_user}","gists_url":"https://api.github.com/users/sodatea/gists{/gist_id}","starred_url":"https://api.github.com/users/sodatea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sodatea/subscriptions","organizations_url":"https://api.github.com/users/sodatea/orgs","repos_url":"https://api.github.com/users/sodatea/repos","events_url":"https://api.github.com/users/sodatea/events{/privacy}","received_events_url":"https://api.github.com/users/sodatea/received_events","type":"User","site_admin":false},"created_at":"2018-08-23T06:42:35Z","updated_at":"2018-08-23T06:42:35Z","author_association":"MEMBER","body":"这个问题出在 iView，请给他们提 bug。\r\n\r\n------\r\n\r\n改编译范围请用 `transpileDependencies: ['iview']`，不要用 `include.add`，因为默认配置里用了 `exclude`，在 webpack 中 `exclude` 的优先级高于 `include`。\r\n\r\n但是加了这个选项后在所有浏览器里都会报错，因为 iView 里[这个文件](https://github.com/iview/iview/blob/341e73ce4363649ffa8544376f04a22ef15a7f0b/src/utils/date.js )不兼容 ES Module。该文件是用很旧版本的 UMD 格式打包的，新版本 UMD [修复了报错的问题](https://github.com/umdjs/umd/pull/125)，但没有解决和 ES Module 互操作的问题。在 Webpack 4 中，ES Module 不能和 CommonJS / UMD 混用。\r\n\r\n所以这里本质上是 iView 对 Webpack 4 支持的问题，让他们把源码全部转成 ES Module 就好了。"}}
{"actor":{"display_login":"sodatea"}}