Configuration

NukeJS works without any config. Create nuke.config.ts when you need to override defaults.

nuke.config.ts

Place this file at the project root. All options are optional.

nuke.config.tstypescript
export default {
    // Directory for API route handlers
    // Default: './server'
    serverDir: './server',

    // Dev server port
    // Default: 3000 (auto-increments if port is in use)
    port: 3000,

    // Logging verbosity:
    //   false    — silent (default)
    //   'error'  — errors only
    //   'info'   — startup messages + errors
    //   true     — all debug output
    debug: false,
}

Options reference

OptionTypeDefaultDescription
serverDirstring'./server'Path to your API route handlers
portnumber3000Dev server port
debugboolean | 'error' | 'info'falseLogging verbosity

Environment variables

These environment variables control the production server:

VariableDescription
ENVIRONMENT=productionDisables HMR and file watching
PORTPort for the production HTTP server
terminalbash
PORT=8080 ENVIRONMENT=production node dist/index.mjs

TypeScript path aliases

If you want path aliases (e.g. @/components), add them to tsconfig.json:

tsconfig.jsonjson
{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "@/*": ["app/*"]
        }
    }
}