Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

@salesforce/b2c-tooling-sdk / config / loadDwJson

Function: loadDwJson()

loadDwJson(options): DwJsonConfig | undefined

Defined in: packages/b2c-tooling-sdk/src/config/dw-json.ts:173

Loads configuration from a dw.json file.

If an explicit path is provided, uses that file. Otherwise, looks for dw.json in the startDir (or cwd). Does NOT search parent directories.

Use findDwJson() if you need to search upward through parent directories.

Parameters

options

LoadDwJsonOptions = {}

Loading options

Returns

DwJsonConfig | undefined

The parsed config, or undefined if no dw.json found

Example

ts
// Load from ./dw.json (current directory)
const config = loadDwJson();

// Load from specific directory
const config = loadDwJson({ startDir: '/path/to/project' });

// Use named instance
const config = loadDwJson({ instance: 'staging' });

// Explicit path
const config = loadDwJson({ path: './config/dw.json' });

All rights reserved.