AbsoluteJS

Production Build

Build and run your AbsoluteJS application in production with optimized bundles and proper process management.

#Building for Production

The build command bundles all your frontend code, generates hashed asset filenames for cache busting, and creates the manifest file for asset lookup:

BASH
# Build for production using the CLI
absolute start src/backend/server.ts

# This runs the build from absolute.config.ts which:
# 1. Bundles all frontend code
# 2. Generates hashed asset filenames
# 3. Creates the manifest for asset lookup
# 4. Starts the production server

Bundled Assets

All frontend code is bundled and minified for optimal load times.

Cache Busting

Hashed filenames ensure browsers always get the latest version.

#Profiling the Build

When a build feels slow, run absolute build --profile to see where the time goes. It prints the slowest phases and a per-framework rollup, so you can tell whether a single framework's compile or a particular bundle is the bottleneck before you start optimizing.

BASH
$ absolute build --profile

 built in 4.21s

  Slowest phases
    angular ssr compile   1.84s
    vue bundle            0.97s
    react bundle          0.61s
    svelte bundle         0.42s
    assets + manifest     0.18s

  By framework
    angular  2.10s   react  0.61s   vue  0.97s   svelte  0.42s

#Running in Production

Start your production server directly with Bun, or use a process manager like PM2 for automatic restarts and clustering:

BASH
# Or build and start separately
bun run build
bun run src/backend/server.ts

# Or with PM2 for process management
pm2 start bun --name "my-app" -- run src/backend/server.ts

#Optimization Tips

Environment variablesSet NODE_ENV=production to enable optimizations
Process managerUse PM2 or systemd for automatic restarts and logging
Reverse proxyPut nginx or Caddy in front for SSL termination and caching
Health checksAdd a /health endpoint for load balancer health checks