xolvio / storybook-webpack-federation-plugin

Exposes all the components in your Storybook as Webpack 5 federated components.
MIT License
57 stars 5 forks source link

remove /index from expose object key #7

Closed TillaTheHun0 closed 4 years ago

TillaTheHun0 commented 4 years ago

I'll often organize components like such:

/Button
--| index.jsx
--|...

Where index.jsx is the barrel that I export any public facing APIs of the module. Currently this is producing an expose object like:

{
   'Button/index': 'Button/index.jsx`
}

which means the import would have to be import Button from 'xolvio_ui/Button/index' which isn't very intuitive since I can usually omit the index part using regular import/export semantics.

This PR removes the /index at the end of the path so the expose object looks more like:

{
   'Button': 'Button/index.jsx`
}

which means the import would be just import Button from 'xolvio_ui/Button'