Skip to content

Commit

Permalink
webui: Fix source map generation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
M4rtinK committed Jul 26, 2023
1 parent 93b074b commit a489386
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions anaconda.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ui/webui/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a489386

Please sign in to comment.