Cli
Build
Build
build
Build the project for production deployment.
Usage
nailgun buildDescription
The build command compiles and prepares your Zodula project for production deployment. It runs build scripts for all apps in your project.
What It Does
- Starts up the Zodula server
- Loads all apps in the project
- Runs build scripts for each app
- Compiles TypeScript and other assets
- Prepares production-ready files
Build Process
For each app, the build process:
- Looks for a build script at
scripts/build - Imports and runs the build script if found
- Compiles TypeScript files
- Bundles assets and dependencies
- Optimizes for production
App Build Scripts
Each app can have its own build script at apps/your-app/scripts/build.ts:
export default async function build() {
// Your custom build logic here
console.log('Building app...');
// Example: Compile TypeScript
// Example: Bundle assets
// Example: Optimize for production
}When to Use
Run build when:
- Preparing for production deployment
- Creating production builds
- Before deploying to servers
- When you need optimized assets
- As part of CI/CD pipelines
Example
$ nailgun build
✓ Starting build process...
✓ Building app: my-monorepo
✓ Building app: another-app
✓ Build completed successfullyProduction Considerations
- Build outputs are optimized for production
- Assets are minified and compressed
- TypeScript is compiled to JavaScript
- Dependencies are bundled efficiently
Tips
- Run
buildbefore deploying to production - Test your build locally before deployment
- Use build outputs for production servers
- Keep build scripts simple and focused
- Consider using CI/CD for automated builds
Zodula