const VueLoaderPlugin = require('vue-loader/lib/plugin'); // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const MiniCssExtractPlugin = require('mini-css-extract-plugin'); module.exports = { module: { rules: [ { test: /\.vue$/, loader: 'vue-loader', options: { loaders: { scss: 'style-loader!css-loader!sass-loader' }, }, }, { test: /\.css$/, use:[ { loader: MiniCssExtractPlugin.loader, options: { hmr: process.env.NODE_ENV === 'development', }, }, 'css-loader', ] }, { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: [ ['@babel/preset-env'] ] } } }, { test: /\.(png|jpg|gif|svg|woff|ttf)$/, loader: 'file-loader', options: { name: '[name].[ext]?[hash]' } } ] }, plugins: [ new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output // all options are optional filename: '[name]/main.css', ignoreOrder: false, // Enable to remove warnings about conflicting order }), new VueLoaderPlugin(), // new BundleAnalyzerPlugin(), ] };