Documentation

build Command

Build your Frame-Master project for production deployment.

📖 Usage

Run the build command to create optimized production assets.

terminal
frame-master build

🔨 What It Does

The build command performs a complete production build.

1.
Initialize Server

Loads configuration and initializes all plugins

2.
Merge Build Configs

Collects and merges buildConfig from all plugins

3.
Trigger serverStart Hook

Executes all plugins' serverStart hooks

4.
Run beforeBuild Hooks

Executes all plugins' beforeBuild hooks in parallel

5.
Execute Bun.build()

Bundles and optimizes all entrypoints

6.
Run afterBuild Hooks

Executes all plugins' afterBuild hooks

7.
Generate Report

Shows build summary with file sizes and statistics

📊 Build Output

The build command provides detailed output about the build process.

terminal output
┌─────────────────────────────────────────┐
│ 🔨 Starting Frame Master Build │
└─────────────────────────────────────────┘
┌─────────────────────────────────────────┐
│ ✅ Build Completed Successfully │
├─────────────────────────────────────────┤
│ Duration: 245.32ms │
│ Outputs: 12 files │
└─────────────────────────────────────────┘
📦 Build Summary:
Total Size: 156.42KB
Average Size: 13.04KB
🔝 Largest Files:
45.23KB - build/client.js
32.15KB - build/vendor.js
28.67KB - build/styles.css

🔍 Verbose Mode

Enable detailed logging for debugging build issues.

terminal
frame-master --verbose build
💡

Plugin Logging

Plugins can enable build logging by setting build.enableLoging: true in their configuration.

⚙️ Build Configuration

Configure the build through plugins.

frame-master.config.ts
import { defineConfig } from "frame-master";
export default defineConfig({
plugins: [
{
name: "my-build-config",
version: "1.0.0",
build: {
buildConfig: {
minify: true,
sourcemap: "external",
target: "browser",
external: ["react", "react-dom"],
},
beforeBuild: async (config, builder) => {
console.log("Preparing build...");
},
afterBuild: async (config, result, builder) => {
console.log(`Built ${result.outputs.length} files`);
},
enableLoging: true,
},
},
],
});
💡

Learn More

See the Build System documentation for detailed configuration options.

📤 Exit Codes

The build command returns different exit codes.

0Build successful
1Build failed

🎯Next Steps