add jsfiddle demo

This commit is contained in:
yiminghe 2015-11-23 15:20:42 +08:00
parent c14dcc7e40
commit e47e1c8db6
3 changed files with 30 additions and 1 deletions

View File

@ -7,6 +7,14 @@
Ant Design React 致力于提供给程序员**愉悦**的开发体验。
## JSFiddle
最简单尝试 antd 的方式是使用以下 JSFiddle 例子, 也推荐 fork 这个例子来进行 bug report, 注意不要在实际项目中使用
- [antd JSFiddle](http://jsfiddle.net/yiminghe/a0pzy83a/1/)
## Using antd from npm
实际项目开发中,你会需要对 ES2015 和 JSX 代码的构建、调试、代理、打包部署等一系列工程化的需求。
我们提供了一套 `npm` + `webpack` 的开发工具链来辅助开发,下面我们用一个简单的实例来说明。

View File

@ -108,7 +108,7 @@
"start": "npm run clean && nico server --watch",
"clean": "rm -rf _site dist",
"deploy": "rm -rf node_modules && node scripts/install.js && npm run just-deploy",
"just-deploy": "npm run clean && webpack --config webpack.deploy.config.js && NODE_ENV=PRODUCTION nico build && node scripts/deploy.js",
"just-deploy": "npm run clean && webpack --config webpack.deploy.config.js && webpack --config webpack.antd.config.js && NODE_ENV=PRODUCTION nico build && node scripts/deploy.js",
"lint": "eslint components test index.js --ext '.js,.jsx'",
"test": "npm run lint && webpack && npm run jest",
"jest": "jest",

21
webpack.antd.config.js Normal file
View File

@ -0,0 +1,21 @@
var config = require('./webpack.config');
config.entry = {
'antd': ['./index.js']
};
config.externals = {
'react': {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom'
}
};
config.output.library = 'antd';
config.output.libraryTarget = 'umd';
module.exports = config;