Skip to content

Commit 6cbf856

Browse files
tanner-reitsrwaskiewicz
authored andcommitted
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 9865254 commit 6cbf856

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

versioned_docs/version-v2/output-targets/custom-elements.md

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

75-
| Option | Description |
76-
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77-
| `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. |
78-
| `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. |
79-
80-
<!-- TODO(STENCIL-457): Move this info to the appropriate option on `customElementsExportBehavior` -->
81-
82-
### autoDefineCustomElements
83-
84-
By default, consumers of the `dist-custom-elements` output target need to
85-
register each Stencil component that they want to use in the bundle manually.
86-
Setting this flag to `true` will define a component automatically with the
87-
`CustomElementRegistry` when the component's module is imported. Note that this
88-
will also automatically recursively define any child components as well.
89-
90-
This flag defaults to `false` when omitted from a Stencil configuration file.
75+
| Option | Description |
76+
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77+
| `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. |
78+
| `auto-define-custom-elements` | A component and its children will be automatically defined with the `CustomElementRegistry` when the component's module is imported. |
79+
| `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. |
9180

9281
:::note
9382
At this time, components that do not use JSX cannot be automatically

0 commit comments

Comments
 (0)