Skip to content

Latest commit

 

History

History
109 lines (63 loc) · 2.68 KB

UserConfig.md

File metadata and controls

109 lines (63 loc) · 2.68 KB

@sdeverywhere/build / UserConfig

Interface: UserConfig

The sde configuration as defined by the user, either inline or in a sde.config.js file.

Properties

rootDir

Optional rootDir: string

The project root directory. If undefined, the current directory is assumed to be the project root. This directory should contain all the model and config files referenced during the build process.


prepDir

Optional prepDir: string

The directory used to prepare the model. If undefined, an 'sde-prep' directory will be created under the resolved rootDir.


modelFiles

modelFiles: string[]

The mdl files to be built (must provide one or more).


modelInputPaths

Optional modelInputPaths: string[]

Paths to files that are considered to be inputs to the model build process. These can be paths to files or glob patterns (relative to the project directory). If left undefined, this will resolve to the modelFiles array.


watchPaths

Optional watchPaths: string[]

Paths to files that when changed will trigger a rebuild in watch mode. These can be paths to files or glob patterns (relative to the project directory). If left undefined, this will resolve to the modelFiles array.


genFormat

Optional genFormat: "js" | "c"

The code format to generate. If 'js', the model will be compiled to a JavaScript file. If 'c', the model will be compiled to a C file (in which case an additional plugin will be needed to convert the C code to a WebAssembly module). If undefined, defaults to 'js'.


outListingFile

Optional outListingFile: string

If defined, the build process will write a JSON file to the provided path that lists all dimensions and variables in the model. This can be an absolute path, or if it is a relative path it will be resolved relative to the rootDir for the project.


plugins

Optional plugins: Plugin[]

The array of plugins that are used to customize the build process. These will be executed in the order defined here.


modelSpec

modelSpec: (context: BuildContext) => Promise<ModelSpec>

Type declaration

(context): Promise<ModelSpec>

Called before the "generate model" steps are performed.

You must implement this function so that the generated model is configured with the desired inputs and outputs.

Parameters
Name Type
context BuildContext
Returns

Promise<ModelSpec>

A ModelSpec that defines the model inputs and outputs.