2019-04-09 00:21:00 +02:00
|
|
|
'use strict'
|
|
|
|
|
2019-06-06 17:37:43 +02:00
|
|
|
const webpack = require('webpack')
|
2019-04-09 00:21:00 +02:00
|
|
|
const merge = require('webpack-merge')
|
|
|
|
const baseConfig = require('./webpack.config.base')
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
2020-11-25 15:25:57 +01:00
|
|
|
const TerserPlugin = require("terser-webpack-plugin");
|
2019-04-09 00:21:00 +02:00
|
|
|
|
|
|
|
module.exports = merge(baseConfig, {
|
|
|
|
mode: 'production',
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.css?$/,
|
|
|
|
use: [
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
'css-loader'
|
|
|
|
]
|
|
|
|
}, {
|
2019-06-06 17:37:43 +02:00
|
|
|
test: /\.scss?$/,
|
2019-04-09 00:21:00 +02:00
|
|
|
use: [
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
'css-loader',
|
|
|
|
'sass-loader'
|
|
|
|
]
|
2019-06-17 14:07:27 +02:00
|
|
|
}, {
|
|
|
|
test: /\.(png|jpg|gif)$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'url-loader',
|
|
|
|
options: {
|
|
|
|
limit: 5000
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-04-09 00:21:00 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2020-11-25 15:25:57 +01:00
|
|
|
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: []
|
2019-04-09 00:21:00 +02:00
|
|
|
})
|