tighten / ziggy

Use your Laravel routes in JavaScript.
MIT License
3.83k stars 247 forks source link

Vue Plugin isnt delivered with Composer package #726

Closed syntafin closed 5 months ago

syntafin commented 5 months ago

Ziggy version

2.0.4

Laravel version

10.47.0

Description

After upgrading to Ziggy 2 and changing the necressary parts I cant compile the VueJS frontend anymore, as the said VueJS plugin described here: https://github.com/tighten/ziggy?tab=readme-ov-file#vue

doesnt exist in the package when installed via Composer, this results in an exception when trying to build the assets:

[plugin:vite:import-analysis] Failed to resolve import "../../vendor/tightenco/ziggy/dist/vue.es.js" from "resources/js/app.js". Does the file exist?

I created the file for my own from the file in the git repository, but on every update it will get deleted this way.

Ziggy call and context

import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.es.js';
import { Ziggy } from './ziggy';

createInertiaApp({
    title: (title) => `${title} - ${appName}`,
    resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
    setup({el, App, props, plugin})
        return createApp({render: () => h(App, props)})
            .use(ZiggyVue, Ziggy)
            .mount(el);
    },
    progress: {
        color: '#f600ff',
    },
});

Ziggy configuration

-

Route definition

-