{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/3947","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/3947/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/3947/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/3947/events","html_url":"https://github.com/ant-design/ant-design/issues/3947","id":190920312,"number":3947,"title":"TypeError: (0 , _moment2.default) is not a function","user":{"login":"pastelsky","id":8946207,"avatar_url":"https://avatars.githubusercontent.com/u/8946207?v=3","gravatar_id":"","url":"https://api.github.com/users/pastelsky","html_url":"https://github.com/pastelsky","followers_url":"https://api.github.com/users/pastelsky/followers","following_url":"https://api.github.com/users/pastelsky/following{/other_user}","gists_url":"https://api.github.com/users/pastelsky/gists{/gist_id}","starred_url":"https://api.github.com/users/pastelsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pastelsky/subscriptions","organizations_url":"https://api.github.com/users/pastelsky/orgs","repos_url":"https://api.github.com/users/pastelsky/repos","events_url":"https://api.github.com/users/pastelsky/events{/privacy}","received_events_url":"https://api.github.com/users/pastelsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"benjycui","id":3580607,"avatar_url":"https://avatars.githubusercontent.com/u/3580607?v=3","gravatar_id":"","url":"https://api.github.com/users/benjycui","html_url":"https://github.com/benjycui","followers_url":"https://api.github.com/users/benjycui/followers","following_url":"https://api.github.com/users/benjycui/following{/other_user}","gists_url":"https://api.github.com/users/benjycui/gists{/gist_id}","starred_url":"https://api.github.com/users/benjycui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjycui/subscriptions","organizations_url":"https://api.github.com/users/benjycui/orgs","repos_url":"https://api.github.com/users/benjycui/repos","events_url":"https://api.github.com/users/benjycui/events{/privacy}","received_events_url":"https://api.github.com/users/benjycui/received_events","type":"User","site_admin":false},"assignees":[{"login":"benjycui","id":3580607,"avatar_url":"https://avatars.githubusercontent.com/u/3580607?v=3","gravatar_id":"","url":"https://api.github.com/users/benjycui","html_url":"https://github.com/benjycui","followers_url":"https://api.github.com/users/benjycui/followers","following_url":"https://api.github.com/users/benjycui/following{/other_user}","gists_url":"https://api.github.com/users/benjycui/gists{/gist_id}","starred_url":"https://api.github.com/users/benjycui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjycui/subscriptions","organizations_url":"https://api.github.com/users/benjycui/orgs","repos_url":"https://api.github.com/users/benjycui/repos","events_url":"https://api.github.com/users/benjycui/events{/privacy}","received_events_url":"https://api.github.com/users/benjycui/received_events","type":"User","site_admin":false}],"milestone":null,"comments":14,"created_at":"2016-11-22T06:45:07Z","updated_at":"2016-12-29T09:04:49Z","closed_at":null,"body":"<!-- Issue Template -->\r\nI'm trying to use antd as a component library with my existing build system (webpack 2). Can I use components from this library without importing the entire build system?\r\nI did \r\n```\r\nnpm install antd\r\n```\r\nand in my page, added\r\n```jsx\r\nimport { DatePicker } from 'antd'\r\n\r\nexport function Page(){\r\n  return <DatePicker/>\r\n}\r\n```\r\n\r\n#### Error\r\n```\r\nUncaught TypeError: (0 , _moment2.default) is not a function\r\n    at Function.getDefaultProps (?d41d*:78)\r\n    at Object.createClass (ReactClass.js:675)\r\n    at Object../node_modules/rc-time-picker/lib/Panel.js (?d41d*:45)\r\n    at __webpack_require__ (bootstrap d2f4533…:689)\r\n    at fn (bootstrap d2f4533…:110)\r\n    at Object../node_modules/antd/lib/date-picker/wrapPicker.js (wrapPicker.js:21)\r\n    at __webpack_require__ (bootstrap d2f4533…:689)\r\n    at fn (bootstrap d2f4533…:110)\r\n    at Object../node_modules/antd/lib/date-picker/index.js (index.js:23)\r\n    at __webpack_require__ (bootstrap d2f4533…:689)\r\n```\r\n\r\n## Environment\r\nwebpack 2\r\nAntd 2.4.3\r\nNode 7\r\nOSX 10.10\r\n"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/comments/269600794","html_url":"https://github.com/ant-design/ant-design/issues/3947#issuecomment-269600794","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/3947","id":269600794,"user":{"login":"deveedutta","id":1687029,"avatar_url":"https://avatars.githubusercontent.com/u/1687029?v=3","gravatar_id":"","url":"https://api.github.com/users/deveedutta","html_url":"https://github.com/deveedutta","followers_url":"https://api.github.com/users/deveedutta/followers","following_url":"https://api.github.com/users/deveedutta/following{/other_user}","gists_url":"https://api.github.com/users/deveedutta/gists{/gist_id}","starred_url":"https://api.github.com/users/deveedutta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deveedutta/subscriptions","organizations_url":"https://api.github.com/users/deveedutta/orgs","repos_url":"https://api.github.com/users/deveedutta/repos","events_url":"https://api.github.com/users/deveedutta/events{/privacy}","received_events_url":"https://api.github.com/users/deveedutta/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T09:04:49Z","updated_at":"2016-12-29T09:04:49Z","body":"@KhushbooTaneja This alias has to be added in the `webpack` configuration. [details](https://webpack.github.io/docs/configuration.html#resolve-alias).\r\n\r\n```js\r\n  resolve: {\r\n    modules: ['app', 'node_modules'],\r\n    extensions: [\r\n      '',\r\n      '.js',\r\n      '.jsx',\r\n      '.react.js',\r\n    ],\r\n    mainFields: [\r\n      'jsnext:main',\r\n      'main',\r\n    ],\r\n    alias: {\r\n      // required for moment to work properly\r\n      moment: 'moment/moment.js',\r\n    }\r\n  },\r\n```"}}
{"actor":{"display_login":"deveedutta"}}