You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bb...@apache.org on 2021/11/17 16:36:35 UTC
[airflow] branch improve-react-loading updated: Minimze production js files
This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch improve-react-loading
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/improve-react-loading by this push:
new cc7adb5 Minimze production js files
cc7adb5 is described below
commit cc7adb52a2085ab624d7f84dbac1568ea6a42836
Author: Brent Bovenzi <br...@gmail.com>
AuthorDate: Wed Nov 17 10:35:08 2021 -0600
Minimze production js files
Add TerserPlugin to minimize js files for production builds
---
airflow/www/package.json | 1 +
airflow/www/webpack.config.js | 7 ++++++-
airflow/www/yarn.lock | 37 +++++++++++++++++++++++++++++++++++--
3 files changed, 42 insertions(+), 3 deletions(-)
diff --git a/airflow/www/package.json b/airflow/www/package.json
index c221982..6805051 100644
--- a/airflow/www/package.json
+++ b/airflow/www/package.json
@@ -63,6 +63,7 @@
"style-loader": "^1.2.1",
"stylelint": "^13.6.1",
"stylelint-config-standard": "^20.0.0",
+ "terser-webpack-plugin": "<5.0.0",
"url-loader": "4.1.0",
"webpack": "4.44.2",
"webpack-cli": "3.3.12",
diff --git a/airflow/www/webpack.config.js b/airflow/www/webpack.config.js
index b3dfff3..548fbb0 100644
--- a/airflow/www/webpack.config.js
+++ b/airflow/www/webpack.config.js
@@ -26,6 +26,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const LicensePlugin = require('webpack-license-plugin');
+const TerserPlugin = require('terser-webpack-plugin');
// Input Directory (airflow/www)
// noinspection JSUnresolvedVariable
@@ -248,7 +249,11 @@ const config = {
}),
],
optimization: {
- minimizer: [new OptimizeCSSAssetsPlugin({})],
+ minimize: process.env.NODE_ENV === 'production',
+ minimizer: [
+ new OptimizeCSSAssetsPlugin({}),
+ new TerserPlugin(),
+ ],
},
};
diff --git a/airflow/www/yarn.lock b/airflow/www/yarn.lock
index 8434813..2d643e5 100644
--- a/airflow/www/yarn.lock
+++ b/airflow/www/yarn.lock
@@ -7198,6 +7198,15 @@ jest-watcher@^27.3.1:
jest-util "^27.3.1"
string-length "^4.0.1"
+jest-worker@^26.5.0:
+ version "26.6.2"
+ resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed"
+ integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==
+ dependencies:
+ "@types/node" "*"
+ merge-stream "^2.0.0"
+ supports-color "^7.0.0"
+
jest-worker@^27.3.1:
version "27.3.1"
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.1.tgz#0def7feae5b8042be38479799aeb7b5facac24b2"
@@ -10074,7 +10083,7 @@ source-map-support@^0.4.15:
dependencies:
source-map "^0.5.6"
-source-map-support@^0.5.6:
+source-map-support@^0.5.6, source-map-support@~0.5.20:
version "0.5.20"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9"
integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==
@@ -10105,7 +10114,7 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
-source-map@^0.7.3:
+source-map@^0.7.3, source-map@~0.7.2:
version "0.7.3"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
@@ -10582,6 +10591,21 @@ terminal-link@^2.0.0:
ansi-escapes "^4.2.1"
supports-hyperlinks "^2.0.0"
+terser-webpack-plugin@<5.0.0:
+ version "4.2.3"
+ resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-4.2.3.tgz#28daef4a83bd17c1db0297070adc07fc8cfc6a9a"
+ integrity sha512-jTgXh40RnvOrLQNgIkwEKnQ8rmHjHK4u+6UBEi+W+FPmvb+uo+chJXntKe7/3lW5mNysgSWD60KyesnhW8D6MQ==
+ dependencies:
+ cacache "^15.0.5"
+ find-cache-dir "^3.3.1"
+ jest-worker "^26.5.0"
+ p-limit "^3.0.2"
+ schema-utils "^3.0.0"
+ serialize-javascript "^5.0.1"
+ source-map "^0.6.1"
+ terser "^5.3.4"
+ webpack-sources "^1.4.3"
+
terser-webpack-plugin@^1.4.3:
version "1.4.5"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz#a217aefaea330e734ffacb6120ec1fa312d6040b"
@@ -10606,6 +10630,15 @@ terser@^4.1.2:
source-map "~0.6.1"
source-map-support "~0.5.12"
+terser@^5.3.4:
+ version "5.10.0"
+ resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc"
+ integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==
+ dependencies:
+ commander "^2.20.0"
+ source-map "~0.7.2"
+ source-map-support "~0.5.20"
+
test-exclude@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"