diff --git a/package.json b/package.json index 02c683a3f6..6b145001af 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "babel-preset-react": "^6.16.0", "babel-preset-stage-0": "^6.16.0", "bezier-easing": "^2.0.3", - "bisheng": "^0.24.0", + "bisheng": "^0.25.0", "bisheng-plugin-antd": "^0.15.0", "bisheng-plugin-description": "^0.1.1", "bisheng-plugin-react": "^0.5.0", @@ -156,8 +156,8 @@ "dist": "antd-tools run dist", "compile": "antd-tools run compile", "tsc": "tsc", - "start": "bisheng start -c ./site/bisheng.config.js --no-livereload", - "site": "bisheng build --ssr -c ./site/bisheng.config.js", + "start": "cross-env NODE_ENV=development bisheng start -c ./site/bisheng.config.js --no-livereload", + "site": "cross-env NODE_ENV=production bisheng build --ssr -c ./site/bisheng.config.js", "deploy": "antd-tools run clean && npm run site && bisheng gh-pages --push-only", "pub": "antd-tools run pub", "prepublish": "antd-tools run guard", diff --git a/site/bisheng.config.js b/site/bisheng.config.js index 2a820dfe46..6cb560cc9c 100644 --- a/site/bisheng.config.js +++ b/site/bisheng.config.js @@ -1,6 +1,8 @@ const path = require('path'); const CSSSplitWebpackPlugin = require('css-split-webpack-plugin').default; +const isDev = process.env.NODE_ENV === 'development'; + module.exports = { port: 8001, source: { @@ -61,6 +63,8 @@ module.exports = { }; config.externals = { + react: 'React', + 'react-dom': 'ReactDOM', 'react-router-dom': 'ReactRouterDOM', }; @@ -76,4 +80,7 @@ module.exports = { return config; }, + htmlTemplateExtraData: { + isDev, + }, }; diff --git a/site/theme/static/template.html b/site/theme/static/template.html index 6664a229ae..92cd4abd30 100644 --- a/site/theme/static/template.html +++ b/site/theme/static/template.html @@ -110,6 +110,11 @@