Skip to content

Commit b925122

Browse files
docs(dist-custom-elements): update documentation to reflect index.js changes
This adds documentation of the change to the `dist-custom-elements` output target introduced in stenciljs/core#3368. That PR adds a re-export of all the built components from the `index.js` file, which will support some existing workflows based on the `dist-custom-elements-bundle` output target.
1 parent c5d8852 commit b925122

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

+13
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ import { HelloWorld } from 'my-library/dist/components/hello-world';
3737
customElements.define('hello-world', HelloWorld);
3838
```
3939

40+
The output directory will also contain an `index.js` file which imports and
41+
re-exports all of your components and their respective `defineCustomElement`
42+
helper functions, looking something like this:
43+
44+
```tsx
45+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
46+
export { MyComponent, defineCustomElement as defineCustomElementMyComponent } from './my-component.js';
47+
export {
48+
MyOtherComponent,
49+
defineCustomElement as defineCustomElementMyOtherComponent
50+
} from './my-other-component.js';
51+
```
52+
4053
## Config
4154

4255
### autoDefineCustomElements

0 commit comments

Comments
 (0)