Source directory

The source field is used to specify the source directory of the module.

It must be a subdirectory of the directory where the moon.mod.json file is located and must be a relative path.

When creating a module using the moon new command, a src directory will be automatically generated, and the default value of the source field will be src.

{
  "source": "src"
}

When the source field does not exist, or its value is null or an empty string "", it is equivalent to setting "source": ".". This means that the source directory is the same as the directory where the moon.mod.json file is located.

{
  "source": null
}
{
  "source": ""
}
{
  "source": "."
}