Merge pull request #241 from catleeball/dep

Add terser as minifier.
This commit is contained in:
Radek Kozieł 2021-10-24 10:50:34 +02:00 committed by GitHub
commit a9365185ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 7 deletions

View File

@ -50,9 +50,12 @@
"prettier-eslint-cli": "^5.0.0",
"ramda": "^0.27.1",
"style-loader": "^2.0.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"terser-webpack-plugin": "^5.1.1",
"url-loader": "^4.1.0",
"webpack": "^5.27.1",
"webpack-cli": "^4.5.0"
},
"dependencies": {
"yarn": "^1.22.10"
}
}

View File

@ -1 +1 @@
!function(){function t(){return window.matchMedia(e).matches}var e=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),n=document.querySelector(".language-selector-current"),o=document.querySelector(".language-selector__more");document.body.addEventListener("click",function(){t()||!o||o.classList.contains("hidden")||o.classList.add("hidden")}),n&&n.addEventListener("click",function(e){t()||(e.stopPropagation(),o.classList.toggle("hidden"))})}();
!function(){var e=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),t=function(){return window.matchMedia(e).matches},n=document.querySelector(".language-selector-current"),o=document.querySelector(".language-selector__more");document.body.addEventListener("click",(function(){t()||!o||o.classList.contains("hidden")||o.classList.add("hidden")})),n&&n.addEventListener("click",(function(e){t()||(e.stopPropagation(),o.classList.toggle("hidden"))}))}();

View File

@ -1 +1 @@
!function(){function e(){return window.matchMedia(s).matches}function t(){o&&o.classList.toggle("hidden",!e()),i&&i.classList.toggle("hidden",e()),c&&c.classList.toggle("hidden",!e())}var n=document.querySelector(".container"),i=document.querySelector(".menu"),o=document.querySelector(".menu-trigger"),d=(document.querySelector(".menu__inner--desktop"),document.querySelector(".menu__sub-inner-more-trigger")),c=document.querySelector(".menu__sub-inner-more"),s=getComputedStyle(document.body).getPropertyValue("--phoneWidth");i&&i.addEventListener("click",function(e){return e.stopPropagation()}),c&&c.addEventListener("click",function(e){return e.stopPropagation()}),t(),document.body.addEventListener("click",function(){e()||!c||c.classList.contains("hidden")?e()&&!i.classList.contains("hidden")&&i.classList.add("hidden"):c.classList.add("hidden")}),window.addEventListener("resize",t),o&&o.addEventListener("click",function(e){e.stopPropagation(),i&&i.classList.toggle("hidden")}),d&&d.addEventListener("click",function(e){e.stopPropagation(),c&&c.classList.toggle("hidden"),c.getBoundingClientRect().right>n.getBoundingClientRect().right&&(c.style.left="auto",c.style.right=0)})}();
!function(){var e=document.querySelector(".container"),t=document.querySelector(".menu"),n=document.querySelector(".menu-trigger"),i=(document.querySelector(".menu__inner--desktop"),document.querySelector(".menu__sub-inner-more-trigger")),o=document.querySelector(".menu__sub-inner-more"),d=getComputedStyle(document.body).getPropertyValue("--phoneWidth"),c=function(){return window.matchMedia(d).matches},s=function(){n&&n.classList.toggle("hidden",!c()),t&&t.classList.toggle("hidden",c()),o&&o.classList.toggle("hidden",!c())};t&&t.addEventListener("click",(function(e){return e.stopPropagation()})),o&&o.addEventListener("click",(function(e){return e.stopPropagation()})),s(),document.body.addEventListener("click",(function(){c()||!o||o.classList.contains("hidden")?c()&&!t.classList.contains("hidden")&&t.classList.add("hidden"):o.classList.add("hidden")})),window.addEventListener("resize",s),n&&n.addEventListener("click",(function(e){e.stopPropagation(),t&&t.classList.toggle("hidden")})),i&&i.addEventListener("click",(function(t){t.stopPropagation(),o&&o.classList.toggle("hidden"),o.getBoundingClientRect().right>e.getBoundingClientRect().right&&(o.style.left="auto",o.style.right=0)}))}();

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@ const Webpack = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const path = require("path");
@ -78,9 +78,10 @@ module.exports = (env, { mode }) => ({
name: "vendor",
minChunks: 2,
},
minimize: true,
minimizer: [
new UglifyJsPlugin({
sourceMap: true,
new TerserPlugin({
parallel: true,
}),
],
},