Closed flexchar closed 1 year ago
I recommend trying this package.
Here's the example implementation from Mixjobs, the demo project of Advanced Inertia.
import { defineConfig } from "vite"
import autoimport from "unplugin-auto-import/vite"
export default defineConfig({
plugins: [
autoimport({
vueTemplate: true,
dts: "resources/scripts/types/auto-imports.d.ts",
imports: [
"vue",
"@vueuse/core",
{
"momentum-lock": ["can"],
},
{
"momentum-trail": ["route", "current"],
},
{
"@inertiajs/vue3": ["router", "useForm", "usePage", "useRemember"],
},
],
}),
],
})
Oh this is a great gem, thank you Boris!
PS. put your book on my todo/wish list for the year ;)
EDIT: bought & read; useful resource for newbies.
What a wonderful package! Thank you for it.
Now the question, is it possible to register
route
as global so that I don't need to import it in every single file? :)