diff --git a/README.md b/README.md index 8d02fa9..9ca64be 100644 --- a/README.md +++ b/README.md @@ -68,14 +68,25 @@ The following are properties on that configuration object. Defaults to `StencilConfig#{rootDir}/web-types.json`. -Since v0.3.0. +Since [v0.3.0](https://github.com/stencil-community/stencil-web-types/releases/tag/v0.3.0). -Description: A string that represents the directory to place the output file. -Users may specify either a directory (e.g. '../'), a filename (e.g. 'my-types.json') or both (e.g. '../my-types.json'). -If no filename ending is '.json' is provided, the output target assumes that a filename must be added to the path. -In such cases, the default 'web-types.json' will be added to the path. +Description: A string that represents location of the file generated by this output target. +Users may specify any of the following: +- A relative directory (e.g. `'../'`) +- A filename (e.g. `'my-types.json'`) +- A relative directory ending in a filename (e.g. `'../my-types.json'`). -It is not recommended that users use absolute paths for this setting, as this can cause errors in projects shared by more than one developer. +It is not recommended to use absolute paths for this setting, as this can cause errors in projects shared by more than one developer/environment. +An error will be logged to the console if an absolute path is detected. + +Any relative file path provided will be relative to the 'root directory' of your Stencil project. +By default, this is the directory your project's `stencil.config.ts` is in. + +If the value provided does not end in `'.json'`, the output target assumes that a filename must be added to the path. +In such cases, the default name, `'web-types.json'`, will be added to the path: +- `../` will be transformed to `../web-types.json` +- `./web-types` will be transformed to `./web-types/web-types.json` +- `./my-types.json` will not be transformed, as the provided value ends in `'.json'` ## Using Web Types