1 //node_modules/laravel-mix/src/Api.js
2 /**
3 * Register vendor libs that should be extracted.
4 * This helps drastically with long-term caching.
5 *
6 * @param {Array} libs
7 * @param {string} output
8 */
9 extract(libs, output) {
10 Config.extractions.push({ libs, output });
11
12 return this;
13 };
1 //第二个参数可以alias
2 extract([‘vue‘], ‘public/js/app_vendor.js‘)
3
4 //多个入口文件
5 mix.js(‘resources/assets/js/app.js‘, ‘public/js‘).extract([‘vue‘], ‘public/js/app_vendor.js‘)
.js([‘node_modules/babel-polyfill/lib/index.js‘, ‘resources/assets/js/admin.js‘], ‘public/js/admin.js‘).extract([‘vue‘], ‘public/js/admin_vendor.js‘)