diff --git a/README.md b/README.md index f4b24182de..bbd4e4443b 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ npm run start ```bash # Development npm run start # Start development server +npm run start-chok # Start development server with polling (for network drives) # Building & Testing npm run build # Full production build @@ -100,6 +101,26 @@ npm run clear # Clear Docusaurus cache npm run serve # Serve production build after `npm run build` ``` +### Building/Running Specific Products + +You can build or run the documentation for a single product using the `DOCS_PRODUCT` environment variable: + +**Windows (PowerShell):** +```powershell +$ENV:DOCS_PRODUCT="pingcastle" +npm run start +``` + +**Unix/Linux/macOS:** +```bash +export DOCS_PRODUCT="pingcastle" +npm run start +``` + +This works with any command (`start`, `start-chok`, `build`) and speeds up development when working on a single product. Available product IDs can be found in `src/config/products.js`. + +*Note: you may get a warning when you first run this. This warning doesn't seem to appear again and the site worked as expected* + ### Development Workflow The centralized system makes development simple: diff --git a/package.json b/package.json index c69d7c85f3..cf7545d8db 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "docusaurus": "npx docusaurus", "start": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=false npx docusaurus start --port=4500 --no-open", - "build": "NODE_OPTIONS=--max-old-space-size=16384 npx docusaurus build", + "start-chok": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=true npx docusaurus start --port=4500 --no-open", + "build": "cross-env NODE_OPTIONS=--max-old-space-size=16384 npx docusaurus build", "swizzle": "npx docusaurus swizzle", "clear": "npx docusaurus clear", "serve": "npx serve -s build -l 8080", diff --git a/src/config/products.js b/src/config/products.js index 870e678ff0..ada4c391f4 100644 --- a/src/config/products.js +++ b/src/config/products.js @@ -704,8 +704,14 @@ export function getDefaultProduct() { */ export function generateDocusaurusPlugins() { const plugins = []; + + // Filter products if DOCS_PRODUCT environment variable is set + const targetProduct = process.env.DOCS_PRODUCT; + const productsToProcess = targetProduct + ? PRODUCTS.filter(product => product.id === targetProduct) + : PRODUCTS; - PRODUCTS.forEach((product) => { + productsToProcess.forEach((product) => { product.versions.forEach((version) => { const pluginId = generatePluginId(product.id, version.version); const routeBasePath = generateRouteBasePath(product.path, version.version);