From a489386d884cf8cf63361a68e55b0f8023721826 Mon Sep 17 00:00:00 2001 From: Martin Kolman Date: Tue, 25 Jul 2023 16:24:06 +0200 Subject: [PATCH] webui: Fix source map generation Looks like we had the source map generation condition backwards - so fix it & make sure to properly package the resulting source map files. This seems to add about 600 kB of (compressed) RPM size and a bit more once installed. But with the source files, Firefox seems to be finally able to show the source code during debugging as well as pinpoint errors from the debug tools console even if the actual code is still minified. --- anaconda.spec.in | 2 ++ ui/webui/build.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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..d09f8b65d3c5 100755 --- a/ui/webui/build.js +++ b/ui/webui/build.js @@ -54,7 +54,7 @@ function watch_dirs(dir, on_change) { } const context = await esbuild.context({ - ...!production ? { sourcemap: "linked" } : {}, + ...production ? { sourcemap: "linked" } : {}, bundle: true, entryPoints: ["./src/index.js"], external: ['*.woff', '*.woff2', '*.jpg', '*.svg', '../../assets*'], // Allow external font files which live in ../../static/fonts