Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/kevinrodriguezmorales/siget/llms.txt

Use this file to discover all available pages before exploring further.

Siget uses the @angular/build:application builder — the modern Vite-based build pipeline that ships with Angular 21, replacing the legacy Webpack-based builder. It provides faster incremental builds, first-class ESM output, and tighter bundle budget enforcement out of the box.

Running the Build

Use either the Angular CLI directly or the npm script aliases defined in package.json:
# Production build (default)
ng build

# Equivalent npm alias
npm run build
Both commands compile the application with the production configuration and write all output to the dist/ directory.

Development Build (Watch Mode)

For day-to-day development you can keep a continuous build running in the background. The watch script disables optimization, keeps source maps, and rebuilds automatically whenever a source file changes:
npm run watch
This runs:
ng build --watch --configuration development
Incremental rebuilds are significantly faster than full builds — you get compiled output in dist/ without spinning up the dev server.

Build Configurations

The angular.json configurations block defines two named configurations that override the builder defaults.

Production

"production": {
  "budgets": [
    {
      "type": "initial",
      "maximumWarning": "500kB",
      "maximumError": "1MB"
    },
    {
      "type": "anyComponentStyle",
      "maximumWarning": "4kB",
      "maximumError": "8kB"
    }
  ],
  "outputHashing": "all"
}
outputHashing: "all" appends a content hash to every emitted asset filename (JS chunks, CSS, fonts, images). This enables aggressive long-term browser caching — unchanged assets keep the same hash, so users never re-download files that have not changed.

Development

"development": {
  "optimization": false,
  "extractLicenses": false,
  "sourceMap": true
}
Source maps are emitted so browser DevTools map runtime errors back to your TypeScript source. License extraction is skipped to keep rebuild times short.

Bundle Budgets

Bundle budgets are enforced only in the production configuration. The CLI emits a warning or fails the build when a threshold is crossed.
Budget typeWarning thresholdError threshold
initial500 kB1 MB
anyComponentStyle4 kB8 kB
The initial budget covers everything loaded on the first page visit — the main bundle plus any eagerly imported chunks. The anyComponentStyle budget applies per-component to inline styles compiled from SCSS.
If your initial bundle exceeds 1 MB the build will exit with an error and produce no output. Keep lazy-loaded route modules and large third-party libraries out of the eagerly loaded chunk to stay within budget.
Pass --stats-json to generate a stats.json file inside dist/ that you can feed into tools like the Angular Bundle Analyzer to visualise exactly what is contributing to your bundle size.
ng build --stats-json

npm Scripts Reference

Both scripts are defined in package.json and map directly to Angular CLI commands:
ScriptCommandPurpose
npm run buildng buildFull production build, outputs to dist/
npm run watchng build --watch --configuration developmentContinuous development build with source maps

Deploying the dist/ Output

ng build writes a self-contained static site to dist/siget/browser/. Every file is standalone — you can host the contents on any static file host.

Netlify

Set the publish directory to dist/siget/browser and the build command to npm run build. Netlify’s _redirects file or a netlify.toml rewrite rule handles SPA routing automatically.

Vercel

Import the repository and set the output directory to dist/siget/browser. Add a vercel.json rewrite to serve index.html for all unmatched routes.

GitHub Pages

Use the angular-cli-ghpages package or a GitHub Actions workflow to push dist/siget/browser to the gh-pages branch.

Nginx SPA Routing

When self-hosting on nginx, all unknown paths must fall back to index.html so Angular’s client-side router can handle them:
server {
  listen 80;
  root /var/www/siget/browser;
  index index.html;

  location / {
    # Try the requested path first; fall back to index.html for SPA routes
    try_files $uri $uri/ /index.html;
  }

  # Long-term caching for hashed assets
  location ~* \.(js|css|woff2?|png|jpg|svg|ico)$ {
    expires 1y;
    add_header Cache-Control "public, immutable";
  }
}
Because outputHashing: "all" is enabled in production, hashed asset filenames are unique per build, making it safe to set a one-year Cache-Control header.

Build docs developers (and LLMs) love