'Laravel Mix compile 2 different config
I wrote a webpack config for different ui area like below :
mix.js('resources/js/front/app.js', 'public/js')
.vue({version: 3})
.webpackConfig({
resolve: {
alias: {
'@': path.resolve('resources/js/front'),
},
},
})
.version();
&&
mix
.ts('resources/js/admin/app.ts', 'public/js/admin')
.vue({version: 3})
.extract([
'vue','vue-i18n','ziggy-js','@inertiajs','vuex','sweetalert2', 'yup','bootstrap'
], 'public/js/admin/vendor.js')
.webpackConfig({
resolve: {
alias: {
'@': path.resolve('resources/js/admin'),
},
},
});
When commenting one of them and compile everything works, for each of them. but when run together, version will be applied to below mix section, and extract to upper section.
For version, it's don't matter because i will apply them also, for alias i can use another alias like @front
, but extract is getting noisy... and getting misconfigure.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|