Skip to content

Commit

Permalink
chore: speed up site build mode
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Nov 26, 2021
1 parent 142bda8 commit ea5bb0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
- name: npm run site
id: site
run: npm run site
env:
SITE_ENV: development

- name: upload site artifact
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"site:theme": "npm run site:theme-dark && npm run site:theme-compact",
"site:theme-dark": "cross-env ESBUILD=1 ANT_THEME=dark bisheng build -c ./site/bisheng.config.js",
"site:theme-compact": "cross-env ESBUILD=1 ANT_THEME=compact bisheng build -c ./site/bisheng.config.js",
"site": "npm run site:theme && cross-env NODE_ICU_DATA=node_modules/full-icu ESBUILD=1 concurrently \"bisheng build --ssr -c ./site/bisheng.config.js\"",
"site": "npm run site:theme && cross-env NODE_ICU_DATA=node_modules/full-icu ESBUILD=1 bisheng build --ssr -c ./site/bisheng.config.js",
"sort": "npx sort-package-json",
"sort-api": "antd-tools run sort-api-table",
"start": "antd-tools run clean && cross-env NODE_ENV=development concurrently \"bisheng start -c ./site/bisheng.config.js\"",
Expand Down
7 changes: 7 additions & 0 deletions site/bisheng.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ module.exports = {

delete config.module.noParse;

// Use dev mod to speed up site preview build
// This is used for CI preview build in `preview-build.yml`
if (process.env.SITE_ENV === 'development') {
console.log('Site build with development mode...');
config.mode = 'development';
}

if (ANT_THEME) {
config.mode = 'development';
config.plugins.forEach(plugin => {
Expand Down

0 comments on commit ea5bb0f

Please sign in to comment.