Skip to content

Commit

Permalink
webui: Enable source maps and disable minification
Browse files Browse the repository at this point in the history
Looks like source-maps are necessary to provide context about the source
code structure (eq. not showing it just like a single huge combined JS
file). At the same time they provide context for the minified JS files.

So to reduce the installed size impact, we can turn on minification
again & make sure source maps are built.

This makes debugging possible at all times while keeping the size
impact of shipping the source maps manageable.
  • Loading branch information
M4rtinK committed Jul 31, 2023
1 parent b9f06ae commit 3119c36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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
4 changes: 2 additions & 2 deletions 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" } : {},
sourcemap: "linked",
bundle: true,
entryPoints: ["./src/index.js"],
external: ['*.woff', '*.woff2', '*.jpg', '*.svg', '../../assets*'], // Allow external font files which live in ../../static/fonts
Expand All @@ -63,7 +63,7 @@ const context = await esbuild.context({
".js": "jsx",
".py": "text",
},
minify: false,
minify: production,
nodePaths,
outdir,
target: ['es2020'],
Expand Down

0 comments on commit 3119c36

Please sign in to comment.