Scripts
Contents
The following npm scripts are provided to simplify working with the starter kit from the command line.
These should be executed from the solution root directory. The scripts themselves can be found in the package.json
file in this directory.
npm run build-cms
npm run build-cms
Builds the CMS project using dotnet build
.
npm run build-site
npm run build-site
Builds the Eleventy static site. This is a standard Eleventy build using npx @11ty/eleventy
which is a production-ready build by default.
โ ๏ธ The site build currently fails if the Umbraco Delivery API cannot be contacted or does not return any content. See the troubleshooting page if you are experiencing errors.
npm run clean-cms
npm run clean-cms
Performs a dotnet clean
in the CMS project directory.
npm run clean-site
npm run clean-site
Deletes the Eleventy output and cache directories (Site/_site/
and Site/.cache/
).
npm run clean
npm run clean
Runs clean-cms
and clean-site
sequentially.
npm run dev-cms
npm run dev-cms
Launches the ASP.NET development server (Kestrel by default) from the CMS project directory.
npm run dev-site
npm run dev-site
Launches the Eleventy Dev Server from the site project directory. Uses the wait-on package to ensure that the CMS is listening before running Eleventy.
npm run dev
npm run dev
Uses concurrently to run the dev-cms
and dev-site
commands, well, concurrently...
npm run openapi-gen
npm run openapi-gen
Regenerates the Delivery API client using @hey-api/openapi-ts. This should only need done when the Umbraco Delivery API definition changes and you want to take advantages of new features.
It uses the UMBRACO_BASE_URL
environment variable to locate the Delivery API (so the CMS must be running). This is configured in Site/openapi-ts.config
.
โ ๏ธ This generates TypeScript files in Site/api/delivery/
which are then compiled to JavaScript. The TypeScript files are ignored by default in the Site/.gitignore
file. This is the only thing TypeScript is used for in the project and is configured in Site/tsconfig.json
.