Configuring default settings

User/System wide default DUB values can be specified in settings.json file.

A settings.json file could look like this:

{
	"defaultArchitecture": "x86_64",
	"defaultCompiler": "ldc"
}

The file settings.json can be located in different locations. Last item in list has highest priority.

Windows

Posix

Settings overview

NameTypeDescription
registryUrls string[] Search the given registry URL first when resolving dependencies. Can be specified multiple times. Available registry types:
  • DUB: URL to DUB registry (default)
  • Maven: URL to Maven repository + group id containing dub packages as artifacts. E.g. mvn+http://localhost:8040/maven/libs-release/dubpackages
skipRegistry string Sets a mode for skipping the search on certain package registry types:
  • none: Search all configured or default registries (default)
  • standard: Don't search the main registry (e.g. https://code.dlang.org/)
  • configured: Skip all default and user configured registries
  • all: Only search registries specified with --registry
customCachePaths string[]

Additional paths that contain packages in subfolders with the pattern "(name)-(version)/(name)/".

Can be used to provide prebuilt DUB libraries (e.g. for distribution package maintainers).

defaultCompiler string

Specifies the compiler binary to use (can be a path).

Arbitrary pre- and suffixes to the identifiers below are recognized (e.g. ldc2 or dmd-2.063) and matched to the proper compiler type: dmd, gdc, ldc, gdmd, ldmd

defaultArchitecture string Force a different architecture (e.g. x86 or x86_64)