You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`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
+
58
79
### autoDefineCustomElements
59
80
60
81
By default, consumers of the `dist-custom-elements` output target need to
@@ -66,8 +87,8 @@ will also automatically recursively define any child components as well.
66
87
This flag defaults to `false` when omitted from a Stencil configuration file.
67
88
68
89
> Note: At this time, components created not using JSX may not be automatically
69
-
defined. This is a known limitation of the API and users should be aware of
70
-
it
90
+
>defined. This is a known limitation of the API and users should be aware of
91
+
>it
71
92
72
93
### generateTypeDeclarations
73
94
@@ -77,14 +98,16 @@ Setting this flag to `false` will not generate type declaration files for the `d
77
98
78
99
This flag defaults to `true` when omitted from a Stencil configuration file.
79
100
101
+
> When set to generate type declarations, Stencil respects the export behavior selected via `customElementsExportBehavior` and generates type declarations specific to the content of that file.
102
+
80
103
## Making Assets Available
81
104
82
-
For performance reasons, the generated bundle does not include [local assets](/docs/assets) built within the JavaScript output,
105
+
For performance reasons, the generated bundle does not include [local assets](/docs/assets) built within the JavaScript output,
83
106
but instead it's recommended to keep static assets as external files. By keeping them external this ensures they can be requested on-demand, rather
84
-
than either welding their content into the JS file, or adding many URLs for the bundler to add to the output.
107
+
than either welding their content into the JS file, or adding many URLs for the bundler to add to the output.
85
108
One method to ensure [assets](/docs/assets) are available to external builds and http servers is to set the asset path using `setAssetPath()`.
86
109
87
-
The `setAssetPath()` function is used to manually set the base path where static assets can be found.
110
+
The `setAssetPath()` function is used to manually set the base path where static assets can be found.
88
111
For the lazy-loaded output target the asset path is automatically set and assets copied to the correct
89
112
build directory. However, for custom elements builds, the `setAssetPath(path)` should be
90
113
used to customize the asset path depending on where they are found on the http server.
@@ -93,15 +116,14 @@ If the component's script is a `type="module"`, it's recommended to use `import.
93
116
as `setAssetPath(import.meta.url)`. Other options include `setAssetPath(document.currentScript.src)`, or using a bundler's replace plugin to
94
117
dynamically set the path at build time, such as `setAssetPath(process.env.ASSET_PATH)`.
0 commit comments