let mix = require('laravel-mix');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const { VueLoaderPlugin } = require('vue-loader');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.setPublicPath('../../')
.js('entry-client.js', '/public/test/js/')
.js('entry-server.js', '/public/test/js/')
;
mix.webpackConfig({
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
// включаем извлечение CSS
extractCSS: true,
preserveWhitespace: false
}
},
// ...
]
},
plugins: [new VueLoaderPlugin(), new ExtractTextPlugin({ filename: 'common.css' })],
resolve: {
alias: {
'vue$': 'vue/dist/vue.runtime.common.js'
}
}
});