Workspace support was added in Go 1.18 and Hugo got solid support for it in the v0.109.0 version.
A common use case for a workspace is to simplify local development of a site with its theme modules.
A workspace can be configured in a *.work file and activated with the module.workspace setting, which for this use is commonly controlled via the HUGO_MODULE_WORKSPACE OS environment variable.
See the hugo.work file in the Hugo Docs repo for an example:
Using the use directive, list all the modules you want to work on, pointing to its relative location. As in the example above, it’s recommended to always include the main project (the “.”) in the list.
With that you can start the Hugo server with that workspace enabled:
HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**"
The --ignoreVendorPaths flag is added above to ignore any of the vendored dependencies inside _vendor. If you don’t use vendoring, you don’t need that flag. But now the server is set up watching the files and directories in the workspace and you can see your local edits reloaded.