1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- 'use strict'
- const webpack = require('webpack')
- const merge = require('webpack-merge')
- const baseConfig = require('./webpack.config.base')
- const MiniCssExtractPlugin = require('mini-css-extract-plugin')
- const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
- module.exports = merge(baseConfig, {
- mode: 'production',
- optimization: {
- minimizer: [
- new UglifyJSPlugin({
- uglifyOptions: {
- // Eliminate comments
- comments: false,
- compress: {
- // remove warnings
- warnings: false,
- // Drop console statements
- drop_console: true,
- }
- }
- })
- ]
- // 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'
- // })
- ]
- })
|