Skip to content

Laravel Mix V6

Muah edited this page Nov 3, 2021 · 9 revisions

the new mix requires some extra setup to make things work especially that we are now using wp v5, so

mix.js('resources/assets/js/app.js', 'public/js').vue()

mix.webpackConfig({
    plugins: [
        // fix ReferenceError: Buffer/process is not defined
        new webpack.ProvidePlugin({
            process : 'process/browser',
            Buffer  : ['buffer', 'Buffer']
        })
    ],
    // https://github.com/ctf0/Laravel-Media-Manager/issues/174
    resolve: {
        alias: {
            'vue$': 'vue/dist/vue.common.js' 
        }
    }
})