{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/602","repository_url":"https://api.github.com/repos/ant-design/ant-design-mobile","labels_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/602/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/602/comments","events_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/602/events","html_url":"https://github.com/ant-design/ant-design-mobile/issues/602","id":193029558,"number":602,"title":"Discussion about main field of antd-mobile","user":{"login":"afc163","id":507615,"avatar_url":"https://avatars.githubusercontent.com/u/507615?v=3","gravatar_id":"","url":"https://api.github.com/users/afc163","html_url":"https://github.com/afc163","followers_url":"https://api.github.com/users/afc163/followers","following_url":"https://api.github.com/users/afc163/following{/other_user}","gists_url":"https://api.github.com/users/afc163/gists{/gist_id}","starred_url":"https://api.github.com/users/afc163/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afc163/subscriptions","organizations_url":"https://api.github.com/users/afc163/orgs","repos_url":"https://api.github.com/users/afc163/repos","events_url":"https://api.github.com/users/afc163/events{/privacy}","received_events_url":"https://api.github.com/users/afc163/received_events","type":"User","site_admin":false},"labels":[{"id":417913895,"url":"https://api.github.com/repos/ant-design/ant-design-mobile/labels/discussion","name":"discussion","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-12-02T04:05:01Z","updated_at":"2016-12-12T12:54:01Z","closed_at":null,"body":"https://github.com/ant-design/ant-design-mobile/issues/66\r\nhttps://github.com/ant-design/ant-design-mobile/issues/523\r\n\r\n---\r\n\r\n社区遇到巨量 `import { Xxx } from 'antd-mobile'` 找不到模块（找不到 antd-mobile 或 react-native）的问题，主要解决方案如下：\r\n\r\n1. 接入 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import)：解决没有 main 入口文件的问题。\r\n2. 接入 [resolve.extention](https://github.com/ant-tool/atool-build/blob/e4bd2959689b6a95cb5c1c854a5db8c98676bdb3/src/getWebpackCommonConfig.js#L78)：解决 web 和 native 模块的问题。\r\n\r\n上面两个方案比较影响易用性，很多用户搞不定这个。\r\n\r\n---\r\n\r\n建议：\r\n\r\n`antd-mobile` `antd-mobile-native` 分开，`npm run pub` 时同时发布两个包，这样两个包可以各自指定 main 入口，而且不再需要配置 resolve.extention。\r\n\r\n相关讨论：https://github.com/ant-design/ant-design-mobile/commit/f561b6eb4f577eea502065df93166a88d443e4d9#commitcomment-20043061\r\n"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/comments/266424172","html_url":"https://github.com/ant-design/ant-design-mobile/issues/602#issuecomment-266424172","issue_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/602","id":266424172,"user":{"login":"bang88","id":433259,"avatar_url":"https://avatars.githubusercontent.com/u/433259?v=3","gravatar_id":"","url":"https://api.github.com/users/bang88","html_url":"https://github.com/bang88","followers_url":"https://api.github.com/users/bang88/followers","following_url":"https://api.github.com/users/bang88/following{/other_user}","gists_url":"https://api.github.com/users/bang88/gists{/gist_id}","starred_url":"https://api.github.com/users/bang88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bang88/subscriptions","organizations_url":"https://api.github.com/users/bang88/orgs","repos_url":"https://api.github.com/users/bang88/repos","events_url":"https://api.github.com/users/bang88/events{/privacy}","received_events_url":"https://api.github.com/users/bang88/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T12:54:01Z","updated_at":"2016-12-12T12:54:01Z","body":"这个还是你们写吧，还没怎么用这个项目。"}}
{"actor":{"display_login":"bang88"}}