From ace39a464e847d15682d24f88b2e851d898d3838 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Thu, 21 Apr 2016 20:06:35 +0800 Subject: [PATCH] optimize site --- docs/spec/layout/demo/aside.md | 2 +- docs/spec/layout/demo/ceiling.md | 2 +- docs/spec/layout/demo/top-aside.md | 2 +- docs/spec/layout/demo/top.md | 2 +- package.json | 4 ++-- webpack.config.js | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/spec/layout/demo/aside.md b/docs/spec/layout/demo/aside.md index dc0af34a4c..f6ad090b5b 100644 --- a/docs/spec/layout/demo/aside.md +++ b/docs/spec/layout/demo/aside.md @@ -9,7 +9,7 @@ title: 侧边导航 ````jsx import { Menu, Breadcrumb, Icon } from 'antd'; -import BrowserDemo from 'BrowserDemo'; +import BrowserDemo from 'site/component/BrowserDemo'; const SubMenu = Menu.SubMenu; ReactDOM.render( diff --git a/docs/spec/layout/demo/ceiling.md b/docs/spec/layout/demo/ceiling.md index 01685785e7..97822900dd 100644 --- a/docs/spec/layout/demo/ceiling.md +++ b/docs/spec/layout/demo/ceiling.md @@ -9,7 +9,7 @@ title: 吊顶规范 ````jsx import { Menu, Breadcrumb } from 'antd'; -import BrowserDemo from 'BrowserDemo'; +import BrowserDemo from 'site/component/BrowserDemo'; ReactDOM.render( diff --git a/docs/spec/layout/demo/top-aside.md b/docs/spec/layout/demo/top-aside.md index e72c77c81b..6fe494f1c3 100644 --- a/docs/spec/layout/demo/top-aside.md +++ b/docs/spec/layout/demo/top-aside.md @@ -7,7 +7,7 @@ title: 顶部导航 + 侧边栏 ````jsx import { Menu, Breadcrumb, Icon } from 'antd'; -import BrowserDemo from 'BrowserDemo'; +import BrowserDemo from 'site/component/BrowserDemo'; const SubMenu = Menu.SubMenu; ReactDOM.render( diff --git a/docs/spec/layout/demo/top.md b/docs/spec/layout/demo/top.md index 75ffa91966..f7e3ead9fd 100644 --- a/docs/spec/layout/demo/top.md +++ b/docs/spec/layout/demo/top.md @@ -11,7 +11,7 @@ title: 顶部导航 ````jsx import { Menu, Breadcrumb } from 'antd'; -import BrowserDemo from 'BrowserDemo'; +import BrowserDemo from 'site/component/BrowserDemo'; ReactDOM.render( diff --git a/package.json b/package.json index d0494e3710..a1948f344c 100644 --- a/package.json +++ b/package.json @@ -127,10 +127,10 @@ "scripts": { "babel": "babel components index.js --out-dir lib", "clean-build": "rm -rf _site _data && ./scripts/build-website.js", - "dora": "ANTD=WEBSITE dora -p 8001 --plugins webpack?disableNpmInstall,hmr", + "dora": "RUN_ENV=WEBSITE dora -p 8001 --plugins webpack?disableNpmInstall,hmr", "start": "npm run clean-build && npm run dora", "copy-html": "cp ./index.html ./_site/index.html && mkdir ./_site/_site && mv ./_site/demo-* ./_site/_site", - "site": "npm run clean-build && ANTD=WEBSITE atool-build -o ./_site && npm run copy-html", + "site": "npm run clean-build && RUN_ENV=WEBSITE atool-build -o ./_site && npm run copy-html", "deploy": "rm -rf node_modules && node scripts/install.js && npm run just-deploy", "just-deploy": "npm run site && node scripts/deploy.js", "lint": "npm run srclint && npm run demolint && npm run lesshint", diff --git a/webpack.config.js b/webpack.config.js index 0de80b650e..8e3d175137 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,7 +6,7 @@ module.exports = function (webpackConfig) { return !(plugin instanceof webpack.optimize.CommonsChunkPlugin); }); - if (process.env.ANTD === 'WEBSITE') { + if (process.env.RUN_ENV === 'WEBSITE') { const component = process.env.COMPONENT_STYLE; webpackConfig.entry = { @@ -15,7 +15,7 @@ module.exports = function (webpackConfig) { webpackConfig.resolve.root = process.cwd(); webpackConfig.resolve.alias = { antd: process.cwd(), - BrowserDemo: 'site/component/BrowserDemo', + site: 'site', }; const babelConfig = require('atool-build/lib/getBabelCommonConfig')(); @@ -43,7 +43,7 @@ module.exports = function (webpackConfig) { } } - if (process.env.ANTD === 'PRODUCTION') { + if (process.env.RUN_ENV === 'PRODUCTION') { const entry = ['./style/index.less', './index.js']; webpackConfig.entry = { 'antd.min': entry,