A static site generator for Sitecore JSS applications. Read more and find information on getting started here.
- A working Sitecore JSS React project (v11.02 or higher). Ensure that
jss setup
has been completed so the required files exist in the project. - The follow patches will need to be applied until the next update; #9
npm install jss-static-site-generator --save-dev
- Copy
bootstrap-static.js
andbuild-static.js
from here. - Edit
sitecoreApiHost
inbootstrap-static.js
, change to the domain where your generated site will be hosted. - Add the following commands to your JSS project
package.json
"bootstrap:static:disconnected": "node scripts/bootstrap-static.js --disconnected",
"bootstrap:static:connected": "node scripts/bootstrap-static.js",
"build:static": "npm-run-all --serial bootstrap:static:disconnected build:client build:server --parallel generate:static",
"build:static:connected": "npm-run-all --serial bootstrap:static:connected build:client build:server --parallel generate:static",
"run:static": "npm-run-all --parallel generate:static",
"generate:static": "node ./scripts/build-static.js"
- Run
build:static
orbuild:static:connected
depending on where you want data sourced from.
Assets are compiled into the /static
directory.