I'm using Vite and VueJS in order to build out an application which has the main application scripts, and various plugin scripts which can be loaded in completely independently of the main application (and built at different times).
However, I'm struggling to get the VueJS/Vite configuration working so that the VueJS runtime is used correctly so that the plugin works as it should. For now my Vite config for both is:
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [
vue(),
laravel({
input: ['src/frontend.js'],
refresh: true,
}),
],
resolve: {
alias: {
'~root': __dirname + "/node_modules/",
vue: 'vue/dist/vue.esm-bundler.js',
},
},
});
But doing this while my plugin components appear, items such as v-model just don't work on my plugin's components, presumably by some conflict of having two different vue runtimes? But I can't seem to figure out how to only have a singular runtime to rule this out.
There's no errors output or warnings related to this behaviour so I'm not too sure what is happening