{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/636","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/636/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/636/comments","events_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/636/events","html_url":"https://github.com/ant-design/ant-design-mobile/issues/636","id":195419422,"number":636,"title":"antd-mobile 用typescript+webpack打包时提示找不到react-native definition file.","user":{"login":"mineralres","id":4149781,"avatar_url":"https://avatars.githubusercontent.com/u/4149781?v=3","gravatar_id":"","url":"https://api.github.com/users/mineralres","html_url":"https://github.com/mineralres","followers_url":"https://api.github.com/users/mineralres/followers","following_url":"https://api.github.com/users/mineralres/following{/other_user}","gists_url":"https://api.github.com/users/mineralres/gists{/gist_id}","starred_url":"https://api.github.com/users/mineralres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mineralres/subscriptions","organizations_url":"https://api.github.com/users/mineralres/orgs","repos_url":"https://api.github.com/users/mineralres/repos","events_url":"https://api.github.com/users/mineralres/events{/privacy}","received_events_url":"https://api.github.com/users/mineralres/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-14T01:48:46Z","updated_at":"2016-12-14T03:08:36Z","closed_at":null,"body":"<!-- 请按照下列格式报告问题，务必提供复现步骤，否则恕难解决，感谢您的支持。-->\r\n\r\n#### 本地环境\r\n\r\n<!-- 务必提供 -->\r\n\r\n- antd-mobile 版本：\r\n- 浏览器 (或标明是 react-native) 及其版本：\r\n- 运行环境及其版本：\r\n\r\n#### 你做了什么？\r\nimport { Button } from 'antd-mobile';\r\n\r\n用webpack+typescript+antd-mobile打包\r\n提示\r\n Cannot find type definition file for 'react-native'.\r\n我想可能是因为antd-mobile的web.d.ts文件不能优先被tsc处理\r\n\r\n<!-- 引入 antd-mobile 的 Button -->\r\n\r\n#### 你期待的结果是：\r\n\r\n<!-- 像官网一样正常显示 -->\r\n\r\n#### 实际上的结果：\r\n\r\n<!-- 缺少样式 -->\r\n\r\n#### 可重现的在线演示\r\n\r\n<!-- 请修改并 Fork https://codepen.io/warmhug/pen/bwRPvx -->\r\n"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/comments/266930509","html_url":"https://github.com/ant-design/ant-design-mobile/issues/636#issuecomment-266930509","issue_url":"https://api.github.com/repos/ant-design/ant-design-mobile/issues/636","id":266930509,"user":{"login":"mineralres","id":4149781,"avatar_url":"https://avatars.githubusercontent.com/u/4149781?v=3","gravatar_id":"","url":"https://api.github.com/users/mineralres","html_url":"https://github.com/mineralres","followers_url":"https://api.github.com/users/mineralres/followers","following_url":"https://api.github.com/users/mineralres/following{/other_user}","gists_url":"https://api.github.com/users/mineralres/gists{/gist_id}","starred_url":"https://api.github.com/users/mineralres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mineralres/subscriptions","organizations_url":"https://api.github.com/users/mineralres/orgs","repos_url":"https://api.github.com/users/mineralres/repos","events_url":"https://api.github.com/users/mineralres/events{/privacy}","received_events_url":"https://api.github.com/users/mineralres/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T03:08:36Z","updated_at":"2016-12-14T03:08:36Z","body":"webpack.config.js配置\r\nmodule.exports = {\r\n    entry: \"./src/index.tsx\",\r\n    output: {\r\n        filename: \"bundle.js\",\r\n        path: __dirname + \"/dist\"\r\n    },\r\n\r\n    // Enable sourcemaps for debugging webpack's output.\r\n    devtool: \"source-map\",\r\n\r\n    resolve: {\r\n        // Add '.ts' and '.tsx' as resolvable extensions.\r\n        extensions: [\"\", \".webpack.js\", \".web.js\", \".ts\", \".tsx\", \".js\"]\r\n    },\r\n\r\n    module: {\r\n        loaders: [\r\n            // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.\r\n            { test: /\\.tsx?$/, loader: \"awesome-typescript-loader\" }\r\n        ],\r\n\r\n        preLoaders: [\r\n            // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.\r\n            { test: /\\.js$/, loader: \"source-map-loader\" }\r\n        ]\r\n    },\r\n\r\n    // When importing a module whose path matches one of the following, just\r\n    // assume a corresponding global variable exists and use that instead.\r\n    // This is important because it allows us to avoid bundling all of our\r\n    // dependencies, which allows browsers to cache those libraries between builds.\r\n    externals: {\r\n        \"react\": \"React\",\r\n        \"react-dom\": \"ReactDOM\"\r\n    },\r\n};"}}
{"actor":{"display_login":"mineralres"}}