Configuration ๐ฎโ
Clawject using cosmiconfig to load configuration from different sources. Example file names are:
.clawjectrc
.clawjectrc.json
.clawjectrc.js
.clawjectrc.ts
.config/clawjectrc
.config/clawjectrc.json
.config/clawjectrc.js
.config/clawjectrc.ts
clawject.config.js
clawject.config.ts
package.json
with aclawject
property
If you're using @clawject/language-service
- you may need to restart typescript language service after editing configuration file.
Configuration schemaโ
Configuration schema is:
interface ClawjectConfig {
unsafeTSVersion?: boolean; // Default: false
mode?: 'development' | 'production'; // Default: check docs for default value
typeSystem?: 'nominal' | 'structural'; // Default: 'nominal'
beans?: {
defaultExternal?: boolean; // Default: true
},
imports?: {
defaultExternal?: boolean; // Default: true
}
}
unsafeTSVersion
โ
Allows using TypeScript version not officially supported by this version of Clawject.
- When
true
, Clawject will not check your TypeScript version. - When
false
, Clawject will check your TypeScript version to ensure it's officially compatible with the versions supported by Clawject.
Default value is false
.
mode
โ
Allows choosing between development
and production
modes.
Development mode is created for development purposes, it emits more clawject metadata to support watch mode of compilers.
When development mode is on - Clawject can emit some full file paths.
If mode is not defined in configuration file - mode is determined by the NODE_ENV
environment variable.
- If not set or set to anything other than
development
, the mode will beproduction
. - If set to
development
, the mode will bedevelopment
.
If mode is defined in configuration file - environment variable NODE_ENV
will be ignored.
typeSystem
โ
Allows choosing between nominal
and structural
type system.
- When
nominal
, Clawject will use a nominal type system to distinguish between beans and imports. - When
structural
, Clawject will use a structural type system (default for typescript) to distinguish between beans and imports.
Default value is nominal
.
Read more about nominal and structural type systems.
beans.defaultExternal
โ
- When
true
, all beans are considered external, if not explicitly marked as internal. - When
false
, all beans are considered internal, if not explicitly marked as external.
Default value is true
.
imports.defaultExternal
โ
- When
true
, all imported configurations are considered external, if not explicitly marked as internal. - When
false
, all imported configurations are considered internal, if not explicitly marked as external.
Default value is true
.