Skip to content

Commit

Permalink
docs(dist-custom-elements): update documentation to reflect index.js …
Browse files Browse the repository at this point in the history
…changes

This adds documentation of the change to the `dist-custom-elements`
output target introduced in ionic-team/stencil#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.
  • Loading branch information
alicewriteswrongs committed Jun 9, 2022
1 parent 7bf0fba commit b0058ec
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/docs/output-targets/custom-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ import { HelloWorld } from 'my-library/dist/components/hello-world';
customElements.define('hello-world', HelloWorld);
```

The output directory will also contain an `index.js` file which imports and
re-exports all of your components and their respective `defineCustomElement`
helper functions, looking something like this:

```tsx
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
export { MyComponent, defineCustomElement as defineCustomElementMyComponent } from './my-component.js';
export {
MyOtherComponent,
defineCustomElement as defineCustomElementMyOtherComponent
} from './my-other-component.js';
```

## Config

### autoDefineCustomElements
Expand Down

0 comments on commit b0058ec

Please sign in to comment.