1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- 'use strict'
- const webpack = require('webpack')
- 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'
- }),
- new webpack.DefinePlugin({
- "process.env": "'prod'"
- })
- ]
- })
|