From 97ee3c77a5f39a4c047da3244ed6117a5223c0e6 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Tue, 20 Sep 2022 14:06:38 +0200 Subject: [PATCH] Update webpack config --- package.json | 1 - webpack.config.js | 20 ++++---------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 2f1a1c3..3811347 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "sharp": "^0.29.3", "string-replace-loader": "^3.1.0", "svg-inline-loader": "^0.8.2", - "terser-webpack-plugin": "^5.3.0", "ts-loader": "^9.2.6", "typescript": "^4.5.5", "webpack": "^5.67.0", diff --git a/webpack.config.js b/webpack.config.js index 5d43b22..6ca0496 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,15 +1,11 @@ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); -const TerserJSPlugin = require('terser-webpack-plugin'); const Sharp = require('responsive-loader/sharp'); const InlineSourceWebpackPlugin = require('inline-source-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const webpack = require('webpack'); module.exports = (env, argv) => ({ - watchOptions: { - ignored: /node_modules/, - }, devtool: argv.mode === 'development' ? 'inline-source-map' : false, entry: { index: './src/index.ts', @@ -17,13 +13,6 @@ module.exports = (env, argv) => ({ devServer: { hot: false, }, - optimization: { - minimizer: [ - new TerserJSPlugin({ - terserOptions: { sourceMap: argv.mode === 'development' }, - }), - ], - }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.html', @@ -111,19 +100,18 @@ module.exports = (env, argv) => ({ // for removing whitespace from template strings loader: 'string-replace-loader', options: { - search: /`.*?`/gs, - replace: (match) => match.replace(/\s+/g, ' '), + search: /`\s+`/gs, + replace: ' ', }, }, { loader: 'string-replace-loader', options: { - search: /`.*?`/gs, - replace: (match) => match.replace(/>\s+<'), + search: /`>\s+<`/gs, + replace: '><', }, }, ], - exclude: /node_modules/, }, ], },