Browse Source

download page

pull/29/head
afc163 10 years ago
parent
commit
325406776b
  1. 14
      docs/download.md
  2. 3
      nico.js
  3. 3
      package.json
  4. 4
      site/templates/component.html
  5. 9
      webpack.config.js

14
docs/download.md

@ -5,4 +5,16 @@
---
待补充。
## 直接下载
- [antd.js](http://ant.design/dist/antd.js)
- [antd.css](http://ant.design/dist/antd.css)
> [历史版本](https://github.com/ant-design/ant-design/releases)
## npm
```bash
$ npm install antd --save
```

3
nico.js

@ -13,6 +13,7 @@ exports.site = {
repo: package.repository.url,
issues: package.bugs.url
};
exports.package = package;
exports.theme = 'site';
exports.source = process.cwd();
exports.output = path.join(process.cwd(), '_site');
@ -32,7 +33,7 @@ exports.ignorefilter = function(filepath, subdir) {
};
exports.middlewares = [{
name: 'webpackDevMiddleware',
filter: /antd\.(js|css)(\.map)?$/,
filter: /\.(js|css)(\.map)?$/,
handle: function(req, res, next) {
handler = handler || webpackMiddleware(webpackCompiler, {
publicPath: '/dist/',

3
package.json

@ -51,9 +51,10 @@
"scripts": {
"babel": "babel components --out-dir lib",
"build": "npm run clean && webpack && nico build",
"pack": "npm run clean && webpack --optimize-minimize && nico build",
"start": "npm run clean && nico server --watch",
"clean": "rm -rf _site",
"deploy": "npm run build && node deploy.js",
"deploy": "npm run pack && node deploy.js",
"lint": "eslint components index.js --ext '.js,.jsx'",
"test": "webpack && npm run lint",
"prepublish": "npm run babel"

4
site/templates/component.html

@ -1,11 +1,11 @@
{% extends "page.html" %}
{% block styles %}
<link rel="stylesheet" href="/dist/antd.css">
<link rel="stylesheet" href="/dist/{{ config.package.name }}-{{ config.package.version }}.css">
{% endblock %}
{% block scripts %}
<script src="/dist/antd.js"></script>
<script src="/dist/{{ config.package.name }}-{{ config.package.version }}.js"></script>
<script>
window.require = function(path) {
var result = window;

9
webpack.config.js

@ -1,11 +1,14 @@
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require('path');
var pkg = require('./package');
var entry = {};
entry[pkg.name] = './index.js';
entry[pkg.name + '-' + pkg.version] = './index.js';
module.exports = {
entry: {
antd: './index.js'
},
entry: entry,
resolve: {
extensions: ['', '.js', '.jsx'],

Loading…
Cancel
Save