From 90336cd50c3dd8545334ac31b1c8cb1ea991aed2 Mon Sep 17 00:00:00 2001 From: Martin Kolman Date: Tue, 25 Jul 2023 16:24:06 +0200 Subject: [PATCH] webui: Disable minification Disable minification when we build our JS code, so that the code we ship in our RPMs can be debugged. This should improve the debugging of runtime issues on any media built from RPM packages as well as for any cases where we apply updates images built from RPM packages. We atually don't mind the resulting files being compressed, so just always compress the built files. --- anaconda.spec.in | 2 ++ ui/webui/build.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/anaconda.spec.in b/anaconda.spec.in index b062d841b7a7..2562b4c7a0fa 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -437,7 +437,9 @@ rm -rf \ %{_datadir}/cockpit/anaconda-webui/index.css.LEGAL.txt %{_datadir}/cockpit/anaconda-webui/index.html %{_datadir}/cockpit/anaconda-webui/index.js.gz +%{_datadir}/cockpit/anaconda-webui/index.js.map %{_datadir}/cockpit/anaconda-webui/index.css.gz +%{_datadir}/cockpit/anaconda-webui/index.css.map %{_datadir}/cockpit/anaconda-webui/manifest.json %{_datadir}/metainfo/org.cockpit-project.anaconda-webui.metainfo.xml %{_datadir}/cockpit/anaconda-webui/po.*.js.gz diff --git a/ui/webui/build.js b/ui/webui/build.js index 4930072a9b32..eb832ec3ad6a 100755 --- a/ui/webui/build.js +++ b/ui/webui/build.js @@ -14,7 +14,7 @@ import { stylelintPlugin } from './pkg/lib/esbuild-stylelint-plugin.js'; import { replace } from 'esbuild-plugin-replace'; import { sassPlugin } from 'esbuild-sass-plugin'; -const production = process.env.NODE_ENV === 'production'; +const production = false; const watchMode = process.env.ESBUILD_WATCH === "true" || false; // linters dominate the build time, so disable them for production builds by default, but enable in watch mode const lint = process.env.LINT ? (process.env.LINT !== '0') : (watchMode || !production); @@ -104,7 +104,8 @@ const context = await esbuild.context({ }), cockpitPoEsbuildPlugin({ src_directory: "ui/webui/src/" }), - ...production ? [cockpitCompressPlugin()] : [], + cockpitCompressPlugin(), + cockpitRsyncEsbuildPlugin({ dest: packageJson.name }), {