Skip to content

Commit a3ca657

Browse files
committed
added cross-env, simple per-product build
1 parent fec22b5 commit a3ca657

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"scripts": {
77
"docusaurus": "npx docusaurus",
88
"start": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=false npx docusaurus start --port=4500 --no-open",
9-
"build": "NODE_OPTIONS=--max-old-space-size=16384 npx docusaurus build",
9+
"start-chok": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=true npx docusaurus start --port=4500 --no-open",
10+
"start-product": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=false npx docusaurus start --port=4500 --no-open",
11+
"start-product-chok": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=true npx docusaurus start --port=4500 --no-open",
12+
"build": "cross-env NODE_OPTIONS=--max-old-space-size=16384 npx docusaurus build",
1013
"swizzle": "npx docusaurus swizzle",
1114
"clear": "npx docusaurus clear",
1215
"serve": "npx serve -s build -l 8080",

src/config/products.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,14 @@ export function getDefaultProduct() {
666666
*/
667667
export function generateDocusaurusPlugins() {
668668
const plugins = [];
669+
670+
// Filter products if DOCS_PRODUCT environment variable is set
671+
const targetProduct = process.env.DOCS_PRODUCT;
672+
const productsToProcess = targetProduct
673+
? PRODUCTS.filter(product => product.id === targetProduct)
674+
: PRODUCTS;
669675

670-
PRODUCTS.forEach((product) => {
676+
productsToProcess.forEach((product) => {
671677
product.versions.forEach((version) => {
672678
const pluginId = generatePluginId(product.id, version.version);
673679
const routeBasePath = generateRouteBasePath(product.path, version.version);

0 commit comments

Comments
 (0)