Bili as bundler for UI component libraries
StarpTech opened this issue · comments
Hi,
first of all thanks for this library. It solved my problem to bundle a complex react component with minimal efforts and great defaults like css-modules, latest babel features.
My next requirement is to bundle all components as separate bundles but with shared chunks. The file directory should be preserved. This would allow us to import the component with ESM as follow:
import { Button } from 'my-package'
Input: bili index.js
components
Button
-> index.js
-> index.module.css
index.js
Output:
dist
Button.js
index.js
index.css
There are plenty of solutions for that. I could use just babel or setup rollup manually but then I would lose the ease of use of Bili. What do you think? Rollup should be able to handle this via https://rollupjs.org/guide/en/#preservemodules
Related #268
I think this issue describe a similiar requirement in microbundle developit/microbundle#457
I archived my goal with just rollup. Wonderful article https://levelup.gitconnected.com/code-splitting-for-libraries-bundling-for-npm-with-rollup-1-0-2522c7437697