[Vuejs]-How can I create and configure multiple Vue Instance in Laravel Mix?

4👍

mix
  .js('resources/js/admin.js', 'public/js').vue()
  .js('resources/js/client.js', 'public/js').vue()

On your blade file, inject proper js file like:

@if (str_contains(Route::currentRouteName(), "admin"))
<script src="{{ asset('js/admin.js') }}" defer></script>
@else
<script src="{{ asset('js/clients.js') }}" defer></script>
👤Bulent

0👍

mix.js('resources/front/js/app.js', 'public/js').vue()
.sass('resources/front/css/app.scss', 'public/css')
    .options({
    autoprefixer: {
        options: {
            browsers: [
                'last 6 versions',
            ]
        }
    }
})
mix.browserSync('your_site')


mix.js('resources/admin/js/adminapp.js', 'public/js').vue()
.sass('resources/admin/css/adminapp.scss', 'public/css')
.options({
    autoprefixer: {
        options: {
            browsers: [
                'last 6 versions',
            ]
        }
    }
})
mix.browserSync('your_site/admin')

Leave a comment