Skip to content

Commit 88dda69

Browse files
authored
docs(output-target): custom elements auto-define export behavior (#916)
This commit updates `autoDefineCustomElements` from being a standalone config flag to an option on `customElementsExportBehavior`. This commit is associated with stenciljs/core#3615
1 parent c6be6ef commit 88dda69

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/docs/output-targets/custom-elements.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,19 @@ export const config: Config = {
6161
outputTargets: [
6262
{
6363
type: 'dist-custom-elements',
64-
customElementsExportBehavior: 'default' | 'single-export-module',
64+
customElementsExportBehavior: 'default' | 'auto-define-custom-elements' | 'single-export-module',
6565
},
6666
// ...
6767
],
6868
// ...
6969
};
7070
```
7171

72-
| Option | Description |
73-
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
74-
| `default` | No additional re-export or auto-definition behavior will be performed.<br><br>This value will be used if no explicit value is set in the config, or if a given value is not a valid option. |
75-
| `single-export-module` | All component and custom element definition helper functions will be exported from the `index.js` file in the output directory (see [Defining Exported Custom Elements](#defining-exported-custom-elements) for more information on this file's purpose). This file can be used as the root module when distributing your component library, see [below](#distributing-custom-elements) for more details. |
76-
77-
<!-- TODO(STENCIL-457): Move this info to the appropriate option on `customElementsExportBehavior` -->
78-
79-
### autoDefineCustomElements
80-
81-
By default, consumers of the `dist-custom-elements` output target need to
82-
register each Stencil component that they want to use in the bundle manually.
83-
Setting this flag to `true` will define a component automatically with the
84-
`CustomElementRegistry` when the component's module is imported. Note that this
85-
will also automatically recursively define any child components as well.
86-
87-
This flag defaults to `false` when omitted from a Stencil configuration file.
72+
| Option | Description |
73+
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
74+
| `default` | No additional re-export or auto-definition behavior will be performed.<br><br>This value will be used if no explicit value is set in the config, or if a given value is not a valid option. |
75+
| `auto-define-custom-elements` | A component and its children will be automatically defined with the `CustomElementRegistry` when the component's module is imported. |
76+
| `single-export-module` | All component and custom element definition helper functions will be exported from the `index.js` file in the output directory (see [Defining Exported Custom Elements](#defining-exported-custom-elements) for more information on this file's purpose). This file can be used as the root module when distributing your component library, see [below](#distributing-custom-elements) for more details. |
8877

8978
> Note: At this time, components created not using JSX may not be automatically
9079
> defined. This is a known limitation of the API and users should be aware of

0 commit comments

Comments
 (0)