Issue 1:
I hope this is an easy one, my problem started when I was trying vee validate examples for vue on a project, everything worked fine but I was getiting a lot of warnings caused by two vue references, the one in my vendor file and one imported by vee validate on a single file vue component.

Searching for a fix the one that always popped up its doing an alias to certain vue distribution, this didn’t do anything for me.

As I said previously, I have a vendor file where I import vue, lodash and buefy, then an “admin.js” file where I do my vue component registration and my vue node. Out of nothing I tried to mix everything on a single file and everything was ok, no duplicate references, no warnings, etc.

Apparently when everything is mixed in the same file this component ignored that vee validate vue import , so this is my question, there’s a way to mix my admin file “ignoring” the vue import from vee validate? I’m sorry if this is something to obvious on webpack but I cant get it done and I really want to understand what's happening.

Im using vue@2.6.11 and vee-validate@3.2.5.

This is my laravel mix file with the alias, this is laravel project.

// webpack.mix.js

const mix = require('laravel-mix');

let webpackConfig = {
resolve: {
alias: {
'vue$': path.resolve(__dirname ,'node_modules/vue/dist/vue.esm'),
}
}
};

mix.webpackConfig(webpackConfig)
.js('resources/js/vendor.js', 'public/js')
.js('resources/js/admin.js', 'public/js')
.sass('resources/sass/vendor.scss', 'public/css')
.sass('resources/sass/admin/admin.scss', 'public/css')
.version();

This is my vendor file where I import vue, lodash and buefy.

// vendor.js

require('./bootstrap');

import Vue from 'vue';
window.Vue = Vue;

import _ from 'lodash';
Object.defineProperty(Vue.prototype, '_', { value: _ });

import Buefy from 'buefy';
Vue.use(Buefy,{
defaultIconPack: 'fa',
defaultDayNames: ["D", "L", "M", "M", "J", "V", "S"],

});

And this is my admin file where I do my component registration and my vue node.

// admin.js

Vue.component('create-event-form', require('./components/admin/event/CreateEventForm.vue').default);
Vue.component('show-event', require('./components/admin/event/ShowEvent.vue').default);
Vue.component('edit-event-form', require('./components/admin/event/EditEventForm.vue').default);

...

var root = new Vue({
el: '#admin-root',
});

Issue 2:
小程序打包多个pages入口文件，提取公共引入的文件

module.exports = {

entry,

output: {

filename: '[name].js',

publicPath: '/',

path: resolve('dist'),

},

resolve: {

modules: [resolve(__dirname, 'src'), 'node_modules'],

alias: {

'src': resolve(__dirname, './src'),

}

},

mode:"production",

target:"node-webkit",

module: {

rules:[

{

test:/.(png|jpe?g|gif|svg)(?.*)?$/,

use:['url-loader',

{

loader: 'image-webpack-loader',// 压缩图片

options: {

bypassOnDebug: true,

}

}

]

}

]

},

plugins: [

new webpack.DefinePlugin({

'process.env': "development"

}),

//清除dist文件下的打包文件 官方有误
new CleanWebpackPlugin(),

new UglifyJsPlugin({
include:/src/,
sourceMap: true
}),

/* copy静态文件 */
new CopyWebpackPlugin([
{
from: __dirname + '/src/images',
to: __dirname + '/dist/images'
},
{
from: __dirname + '/src/components',
to: __dirname + '/dist/components',
ignore: ['*/*.xml']
},
{
from: '**/*.wxml',
to: 'pages',
context: path.join(__dirname, 'src/pages')
},
], {
ignore: [
'**/*.wxss',
'**/*.js'
]
}),
new CopyWebpackPlugin([
{
from: '**/*.min.js',
to: 'utils',
context: path.join(__dirname, 'src/utils')
},
]),

],

// 将公共的依赖模块提取到已有的入口 chunk 中，或者提取到一个新生成的 chunk 官方有误

optimization: {

splitChunks: {

cacheGroups: {

commons: {

name: "commons",

chunks: "initial",

minChunks: 2

}

}

}

},

};

node v12.6.2

macOS v10.14.5

webpack v4.43.0