modernweb-dev / storybook-prebuilt

Storybook prebuilt to work with native es modules
MIT License
36 stars 9 forks source link

Re-Export setCustomElements #30

Closed KonnorRogers closed 3 years ago

KonnorRogers commented 3 years ago

Currently, setCustomElements is not reexported in the web-components.js file so when you go do:

import { setCustomElements } from "@web/storybook-prebuilt/web-components.js"

You receive an error.

Here is the Storybook equivalent:

https://github.com/storybookjs/storybook/blob/next/examples/web-components-kitchen-sink/.storybook/preview.js

Perhaps this could be changed to export * from "@storybook/web-components" in case this API changes in the future?

LarsDenBakker commented 3 years ago

Thanks! Export * doesn't work because of the way of the rollup commonjs plugin works. At least when I wrote this code, it may have improved since then.

KonnorRogers commented 3 years ago

Ahhhhh totally makes sense. I forgot about the fun conversion between CJS and ESM.