12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 'use strict'
- const merge = require('webpack-merge')
- const baseConfig = require('./webpack.config.base')
- const MiniCssExtractPlugin = require('mini-css-extract-plugin')
- module.exports = merge(baseConfig, {
- mode: 'production',
- optimization: {
- splitChunks: {
- cacheGroups: {
- commons: {
- test: /[\\/]node_modules[\\/]/,
- name: "vendor",
- chunks: "all",
- },
- },
- },
- },
- module: {
- rules: [
- {
- test: /\.css?$/,
- use: [
- MiniCssExtractPlugin.loader,
- 'css-loader'
- ]
- }, {
- test: /\.scss$/,
- use: [
- MiniCssExtractPlugin.loader,
- 'css-loader',
- 'sass-loader'
- ]
- }
- ]
- },
- plugins: [
- new MiniCssExtractPlugin({
- filename: 'main.css'
- })
- ]
- })
|