{"action":"created","issue":{"url":"https://api.github.com/repos/benjycui/bisheng/issues/143","repository_url":"https://api.github.com/repos/benjycui/bisheng","labels_url":"https://api.github.com/repos/benjycui/bisheng/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/benjycui/bisheng/issues/143/comments","events_url":"https://api.github.com/repos/benjycui/bisheng/issues/143/events","html_url":"https://github.com/benjycui/bisheng/issues/143","id":317529838,"node_id":"MDU6SXNzdWUzMTc1Mjk4Mzg=","number":143,"title":"pageData为undefined","user":{"login":"ChangeHow","id":23733347,"node_id":"MDQ6VXNlcjIzNzMzMzQ3","avatar_url":"https://avatars2.githubusercontent.com/u/23733347?v=4","gravatar_id":"","url":"https://api.github.com/users/ChangeHow","html_url":"https://github.com/ChangeHow","followers_url":"https://api.github.com/users/ChangeHow/followers","following_url":"https://api.github.com/users/ChangeHow/following{/other_user}","gists_url":"https://api.github.com/users/ChangeHow/gists{/gist_id}","starred_url":"https://api.github.com/users/ChangeHow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChangeHow/subscriptions","organizations_url":"https://api.github.com/users/ChangeHow/orgs","repos_url":"https://api.github.com/users/ChangeHow/repos","events_url":"https://api.github.com/users/ChangeHow/events{/privacy}","received_events_url":"https://api.github.com/users/ChangeHow/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-25T08:36:34Z","updated_at":"2018-09-03T10:35:01Z","closed_at":"2018-07-03T09:32:51Z","author_association":"NONE","body":"最近照着antd的文档进行配置，发现根本拿不到pageData，原本想使用pick来输出，但是想了想不怎么现实，输出的控制台是这样的\r\n<img width=\"861\" alt=\"2018-04-25 16 30 25\" src=\"https://user-images.githubusercontent.com/23733347/39234548-27770600-48a6-11e8-8b9a-8c19b8fb30aa.png\">\r\n`bisheng.config.js`的配置如下\r\n```javascript\r\nmodule.exports = {\r\n  source: './src/components',\r\n  output: './doc/_public',\r\n  theme: './doc/theme',\r\n  // theme: 'bisheng-theme-one',\r\n  port: 9000,\r\n  exclude: /README.md/,\r\n  webpackConfig(config) {\r\n    const _alias = {\r\n            parkball: path.resolve(__dirname),\r\n            static: path.join(__dirname, 'doc/theme/static'),\r\n            scripts: path.join(__dirname, 'src/scripts'),\r\n            utils: path.join(__dirname, 'doc/theme/utils'),\r\n          },//utils 输出 React、ReactDOM以及DocumentTitle等lib\r\n          _modules = [\r\n            path.join(__dirname, 'doc/theme/utils'),\r\n            path.join(__dirname, 'src'),\r\n            'node_modules',\r\n          ],//添加模块路径\r\n          _rules = [{\r\n            test: /\\.(js|jsx)?$/,\r\n            include: [\r\n              path.resolve(__dirname, 'doc'),\r\n              path.resolve(__dirname, 'src'),\r\n            ],\r\n            use: {\r\n              loader: 'babel-loader',\r\n              options: {\r\n                presets: ['es2015', 'stage-0', 'react'],\r\n                plugins: [\r\n                  'add-module-exports',\r\n                  'transform-runtime',\r\n                  'transform-decorators-legacy',\r\n                  ['import', {\r\n                    libraryName: 'antd',\r\n                    style: true,\r\n                  }],\r\n                ],\r\n              },\r\n            },\r\n          },];\r\n    config.resolve.alias = _alias;\r\n    config.resolve.modules.concat(_modules);\r\n    config.module.rules.push(..._rules);\r\n    //引入antd库\r\n    config.plugins.push(new CSSSplitWebpackPlugin({ size: 4000 }));\r\n    return config;\r\n  }\r\n};\r\n```\r\n因为项目是基于antd的，如果不配置`babel`就会出现样式丢失的情况，`them--->index.js`配置如下\r\n```javascript\r\nmodule.exports = {\r\n  lazyLoad: true,\r\n  plugins: [\r\n    'bisheng-plugin-toc',\r\n    'bisheng-plugin-antd',\r\n    'bisheng-plugin-react?lang=jsx',\r\n  ],\r\n  routes: _routes,\r\n};\r\n```\r\n目录结构如下图\r\n<img width=\"289\" alt=\"2018-04-25 16 34 20\" src=\"https://user-images.githubusercontent.com/23733347/39234679-8d673af2-48a6-11e8-884c-16a181852d47.png\">\r\n\r\n> 望解答，感激不尽，顺带QAQ文档不全，看着源码解析，antd的生产环境也不好全照搬\r\n> PS： `bisheng-collect`是起到什么作用的？\r\n"},"comment":{"url":"https://api.github.com/repos/benjycui/bisheng/issues/comments/418074459","html_url":"https://github.com/benjycui/bisheng/issues/143#issuecomment-418074459","issue_url":"https://api.github.com/repos/benjycui/bisheng/issues/143","id":418074459,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODA3NDQ1OQ==","user":{"login":"lengjing","id":5450712,"node_id":"MDQ6VXNlcjU0NTA3MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/5450712?v=4","gravatar_id":"","url":"https://api.github.com/users/lengjing","html_url":"https://github.com/lengjing","followers_url":"https://api.github.com/users/lengjing/followers","following_url":"https://api.github.com/users/lengjing/following{/other_user}","gists_url":"https://api.github.com/users/lengjing/gists{/gist_id}","starred_url":"https://api.github.com/users/lengjing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lengjing/subscriptions","organizations_url":"https://api.github.com/users/lengjing/orgs","repos_url":"https://api.github.com/users/lengjing/repos","events_url":"https://api.github.com/users/lengjing/events{/privacy}","received_events_url":"https://api.github.com/users/lengjing/received_events","type":"User","site_admin":false},"created_at":"2018-09-03T10:35:01Z","updated_at":"2018-09-03T10:35:01Z","author_association":"NONE","body":"@ChangeHow \r\n```\r\n{\r\n...\r\nsource: {'doc': './doc'}\r\n}\r\n```"}}
{"actor":{"display_login":"lengjing"}}