diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 0fb82a15df..97db4c35a1 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -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 diff --git a/package.json b/package.json index b34df3e257..57d00e3960 100644 --- a/package.json +++ b/package.json @@ -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\"", diff --git a/site/bisheng.config.js b/site/bisheng.config.js index 93c23082dd..86049f69b4 100644 --- a/site/bisheng.config.js +++ b/site/bisheng.config.js @@ -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 => {