refactor: remove some hard code

This commit is contained in:
Benjy Cui 2016-03-23 10:43:43 +08:00
parent fb6c6abbc7
commit f723d6ca51
7 changed files with 12 additions and 3 deletions

View File

@ -10,6 +10,7 @@
````jsx
import { Menu, Breadcrumb, Icon } from 'antd';
import BrowserDemo from 'BrowserDemo';
const SubMenu = Menu.SubMenu;
ReactDOM.render(

View File

@ -10,6 +10,7 @@
````jsx
import { Menu, Breadcrumb } from 'antd';
import BrowserDemo from 'BrowserDemo';
ReactDOM.render(
<BrowserDemo>

View File

@ -8,6 +8,7 @@
````jsx
import { Menu, Breadcrumb, Icon } from 'antd';
import BrowserDemo from 'BrowserDemo';
const SubMenu = Menu.SubMenu;
ReactDOM.render(

View File

@ -12,6 +12,7 @@
````jsx
import { Menu, Breadcrumb } from 'antd';
import BrowserDemo from 'BrowserDemo';
ReactDOM.render(
<BrowserDemo>

View File

@ -71,7 +71,7 @@
"warning": "~2.1.0"
},
"devDependencies": {
"antd-md-loader": "0.1.0-beta.12",
"antd-md-loader": "0.1.0-beta.13",
"atool-build": "^0.5.0",
"autoprefixer": "^6.3.3",
"babel-cli": "^6.2.0",

View File

@ -2,7 +2,6 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { Link } from 'react-router';
import hljs from 'highlight.js';
import antd from '../../';
function isHeading(type) {
return /h[1-6]/i.test(type);
@ -22,7 +21,7 @@ export function objectToComponent(pathname, object, index) {
}
if (typeof object === 'function') {
return React.cloneElement(object(React, ReactDOM, antd, antd), { key: index });
return React.cloneElement(object(React, ReactDOM), { key: index });
}
if (typeof object === 'string') {

View File

@ -2,5 +2,11 @@ module.exports = function(webpackConfig) {
webpackConfig.entry = {
index: './site/entry/index.jsx',
};
webpackConfig.resolve.root = process.cwd();
webpackConfig.resolve.alias = {
antd: 'index',
BrowserDemo: 'site/component/BrowserDemo',
};
return webpackConfig;
};