Extensions
Description
Idea: be able to extend your app functionalities by simply installing npm packages:
// vite.config.js
import ssr from 'vite-plugin-ssr/plugin'
import renderer from 'vps-renderer-react'
// import renderer from 'vps-renderer-vue'
import sitemap from 'vps-sitemap'
export default {
ssr({
extensions: [renderer(), sitemap()]
})
}
Means: all you have left to do is write your .page.js files.
Calling it extensions and not plugins because all renderer() and sitemap() does is to provide .page.js files.
If you know vps, then you know how to write extensions and how to debug extensions. You can easily fork extensions to your likings. (Whereas plugins usually use another set of APIs than what the end-user uses.)
CC @aleclarson who is quite interested in that space.
I have a very similar idea for Rakkas (and HatTip) but my plan was to make Rakkas plugins plain Vite plugins with some extra keys for Rakkas specific features. This would make things like (hypothetical) @rakkasjs/plugin-telefunc easier to use.
Related: https://github.com/brillout/research/issues/4.
Done https://vite-plugin-ssr.com/extends.