Build Pipeline
Build Pipeline
The UI bundle is built with Gulp 4, using PostCSS for CSS processing, Browserify for JS bundling, and Handlebars for template compilation.
Output is build/ui-bundle.zip (~320 KB).
Build Flow
bundle (series) ├── bundle:build (series) │ ├── clean Remove build/ and public/ │ ├── lint (parallel) │ │ ├── lint:css stylelint (standard config) │ │ └── lint:js eslint (JavaScript Standard Style) │ └── build Process and stage all assets └── bundle:pack Create ui-bundle.zip from staged assets
Gulp Task Graph
| Task | Description | Composition |
|---|---|---|
|
Full build: clean, lint, build, pack |
series(bundle:build, bundle:pack) |
|
Clean + lint + build stages |
series(clean, lint, build) |
|
Create zip from staged assets |
single task |
|
Lint CSS and JS in parallel |
parallel(lint:css, lint:js) |
|
stylelint with standard config |
single task |
|
eslint with JavaScript Standard Style |
single task |
|
Process CSS/JS/HBS/images, stage to |
single task |
|
Remove |
single task |
|
Prettify JS source files |
single task |
|
Build + serve with livereload on |
series(preview:build, preview:serve) |
|
Stage assets + generate preview pages |
parallel(build, preview:build-pages) |
|
Dev server at |
single task |
Entry Points
Three equivalent ways to invoke the build:
| Method | Command |
|---|---|
Gulp (direct) |
|
npm script |
|
Makefile |
|
PostCSS Pipeline
CSS processing chain (configured in gulp.d/tasks/build.js):
-
postcss-import— resolve@importstatements insite.css -
postcss-custom-properties— compile CSS custom properties for older browsers -
postcss-calc— reducecalc()expressions -
postcss-url— rebase asset URLs -
autoprefixer— add vendor prefixes (last 2 versions) -
cssnano— minify (with rule merging disabled to preserve theme selectors)
|
cssnano’s |
Browserify Bundling
JavaScript files matching +([^.])?(.bundle).js are bundled via Browserify with browser-pack-flat for flatter output.
The numbered files (01-nav.js through 07-breadcrumbs.js) are concatenated into site.js.
Vendor files (domus-ui.js, highlight.bundle.js) are loaded separately.
Makefile Interface
| Target | Description |
|---|---|
|
Build UI bundle (default target) |
|
Preview with livereload on |
|
Lint CSS and JS |
|
|
|
Remove |
|
Verify Node.js, npx, and node_modules exist |
|
Show all targets with descriptions |
npm Scripts
| Script | Command |
|---|---|
|
|
|
|
|
|
Key Dependencies
| Package | Version | Category |
|---|---|---|
|
~4.0 |
Build orchestration |
|
~8.0 |
CSS processing |
|
~12.0 |
CSS import resolution |
|
~9.1 |
CSS variable compilation |
|
~9.7 |
Vendor prefix injection |
|
~4.1 |
CSS minification |
|
~16.5 |
JS module bundling |
|
~3.4 |
Flattened JS output |
|
~3.0 |
JS minification |
|
~4.7 |
Template compilation |
|
9.18.3 |
Syntax highlighting |
|
~6.8 |
JS linting (Standard Style) |
|
~13.3 |
CSS linting (Standard config) |
|
~6.2 |
Image optimization |
|
~4.5 |
Roboto font files |
|
~4.5 |
Roboto Mono font files |
|
~2.5 |
Zip packaging |
Source Files
| File | Lines |
|---|---|
|
126 |
|
63 |
|
91 |
|
Build task implementations |
|
Helper functions (create-task, export-tasks) |