Skip to content

How to use in combination with Laravel Mix? #210

@MarcoTroost

Description

@MarcoTroost

Hi,

Thanks to the contributors for making vue components more easy to use!

I would very much like to use this plugin in my project, but i unfortunately don't seem to get it to work using Laravel Mix.
Mix doesn't produce an error, but i can't autoload vue components either.

Webpack.mix.js:

const mix = require('laravel-mix');
const Components = require('unplugin-vue-components/webpack');

mix.webpackConfig({
    plugins: [
        Components({
            dirs: ['./resources/js/components']
        })
    ]
});

mix.js('resources/js/main.js', 'public/js').vue();

main.js:

import { createApp } from 'vue';
import BalmUI from 'balm-ui'; 
import BalmUIPlus from 'balm-ui/dist/balm-ui-plus'; 

const app = createApp({});

app.use(BalmUI);
app.use(BalmUIPlus);

app.mount('#app');

Expected behaviour is that the component ./resources/js/components/RecoverPassword would be imported & initialized automatically.

Hope you can help.

thanks in advance & with kind regards,

Marco

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions