Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Library Mode #781

Open
Secretmapper opened this issue Jul 26, 2021 · 4 comments
Open

Add Library Mode #781

Secretmapper opened this issue Jul 26, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@Secretmapper
Copy link

Is your feature request related to a problem? Please describe.
It's amazing how much functionality is packed into this tiny tool.

One thing I really like about vite is that it has a handy 'Library Mode', which allows you to build your package for distribution. It would be great if wmr has such functionality as well.

Describe the solution you'd like
A config you can add in wmr.config.mjs

@Secretmapper Secretmapper added the enhancement New feature or request label Jul 26, 2021
@ForsakenHarmony
Copy link
Member

For libraries, you can also use microbundle

@developit
Copy link
Member

Indeed! (though I do think Microbundle could be much simpler)

@developit
Copy link
Member

One thing that might be worth considering though, is that it'd be pretty easy for us to add a way to do additional Rollup builds, similar to what Vite provides with build.lib. We'd basically be adding some plugins to the provided options, and passing that on to Rollup here.

@Secretmapper
Copy link
Author

Secretmapper commented Jul 27, 2021

Thanks for the recommendation regarding microbundle! Seems very useful!

One thing I really liked about wmr is that it's really small and has minimal dependencies. If I'm going to be using what is provided by wmr as a library, it'd be perfect.

One thing that might be worth considering though, is that it'd be pretty easy for us to add a way to do additional Rollup builds, similar to what Vite provides with build.lib. We'd basically be adding some plugins to the provided options, and passing that on to Rollup here.

Yes, this is specifically what I was thinking. My usecase is to separate my app into a monorepo. Having wmr have a library mode mean I can just have wmr in every package and build it there.

Addendum: Would it even be possible to support input files via the cli, so that it'd only be one dependency we can reference via '../../scripts' similar to how wmr and create-wmr builds? That would be 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants