123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- '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 TerserPlugin = require("terser-webpack-plugin");
- module.exports = merge(baseConfig, {
- mode: 'production',
- module: {
- rules: [
- {
- test: /\.css?$/,
- use: [
- MiniCssExtractPlugin.loader,
- 'css-loader'
- ]
- }, {
- test: /\.scss?$/,
- use: [
- MiniCssExtractPlugin.loader,
- 'css-loader',
- 'sass-loader'
- ]
- }, {
- test: /\.(png|jpg|gif)$/,
- use: [
- {
- loader: 'url-loader',
- options: {
- limit: 5000
- }
- }
- ]
- }
- ]
- },
- optimization: {
- minimize: true,
- minimizer: [
- new TerserPlugin({
- sourceMap: true, // Must be set to true if using source-maps in production
- parallel: true,
- test: /\.(js|vue)$/,
- // extractComments: true
- terserOptions: {
- compress: {
- drop_console: true,
- },
- },
- })
- ],
- },
- // ,
- // plugins: []
- })
|