Documentation website for the Our Future Health Design System.
pnpm --filter site devThis starts four concurrent watch processes:
- toolkit - Watches and builds toolkit distribution files
- css - Watches and compiles site Sass to CSS
- js - Watches and bundles site JavaScript with webpack
- eleventy - Serves the site with hot reload
The site package runs an external script from the @ourfuturehealth/toolkit package (pnpm --filter @ourfuturehealth/toolkit watch). This is necessary because the site uses two different build outputs of the toolkit:
The site's webpack configuration imports toolkit source files directly:
// scripts/main.js
import "@ourfuturehealth/toolkit/ofh";Webpack watches these source files automatically and rebundles when they change. The output includes both toolkit components and site-specific documentation styles.
Outputs: site/dist/css/main.css, site/dist/js/main.min.js
Component examples are displayed in iframes using standalone toolkit files without documentation UI styles:
<!-- views/_includes/standalone-example-layout.njk -->
<link
href="/ofh-design-system-toolkit/ofh-design-system-toolkit.css"
rel="stylesheet"
/>
<script
src="/ofh-design-system-toolkit/ofh-design-system-toolkit.js"
defer
></script>These files come from the toolkit's gulp build process, which must run separately because webpack doesn't generate standalone, framework-agnostic distribution files.
Outputs: toolkit/dist/ofh-design-system-toolkit.css, toolkit/dist/ofh-design-system-toolkit.js
Eleventy is configured to watch toolkit/dist/ and trigger hot reload when these standalone files change.
pnpm --filter site buildBuilds the static site to site/dist/.
- Eleventy - Static site generator
- Sass - CSS preprocessing
- Webpack - JavaScript bundling
- Nunjucks - Templating engine