thepassle / create-lit-app

Create LitHTML apps with no build configuration. (LitHTML/Redux/Webpack/Express)
https://create-lit-app.herokuapp.com
110 stars 10 forks source link

Switch to Rollup to support modules #14

Open justinfagnani opened 5 years ago

justinfagnani commented 5 years ago

WebPack doesn't support module output. It's a shame that with WebPack we can't use the native module loader. Would you consider switching to Rollup?

thepassle commented 5 years ago

Hey Justin, I initially went with WebPack because of the convention "Use webpack for apps, and Rollup for libraries", but I agree that having a module output would play really nice with web components. Admittedly though, I don't have that much experience with Rollup so it will take me some time to research and create a set up for it.

Alternatively, there could be a similar package like create-lit-component or something like that. Either way, i'll spend some time and dive into this, thanks for pointing this out :)

justinfagnani commented 5 years ago

"Use webpack for apps, and Rollup for libraries"

I've heard this, but I don't think it's a useful convention. First, you just shouldn't bundle module-based packages at all. Second, I don't think there's a meaningful distinction between the two, except that Rollup is a lot more module friendly.

Ideally for me, this project would work without bundling, and bundling would be a production-time-only optimization, with the choice of bundler being only a light-weight opinion that users could change easily.