Closed alemagio closed 6 months ago
Right now that's the only way to do it, just copy virtual/create.js
from the @fastify/vue
package and place it in your Vite root directory — @fastify/vue
will automatically use your version of it as long as you always import from /:create.js
.
I'm open to suggestions on how to make these types of customisations easier!
Hey @galvez
sorry for the late response.
Anyway, I did that and works perfectly, my idea could be to make the system "merge" the existing create.js
and the one added in my project root.
So my create.js
might appear like this
export default async function create ({ instance, ctx, router }) {
instance.use(myPlugin)
return { instance, ctx, router }
}
Like a middleware. Just wondering, not sure if it's doable.
Let's keep this issue open while I thinker with it a bit.
Thanks for giving @fastify/vue a shot!
https://github.com/fastify/fastify-vite/releases/tag/vue-v0.4.0
Now please go tweet merrily about this project kthxbai 😸
Prerequisites
Issue
Hi,
I am trying to use Vue plugins but I need access to the Vue instance. The only thing I could do was to copy the source code from the create.js file in the repo and change it as I needed. Is there a better way?