Skip to content

Commit

Permalink
webui: Disable minification
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
M4rtinK committed Jul 25, 2023
1 parent f0c0048 commit 90336cd
Show file tree
Hide file tree
Showing 2 changed files with 5 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
5 changes: 3 additions & 2 deletions ui/webui/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -104,7 +104,8 @@ const context = await esbuild.context({
}),
cockpitPoEsbuildPlugin({ src_directory: "ui/webui/src/" }),

...production ? [cockpitCompressPlugin()] : [],
cockpitCompressPlugin(),

cockpitRsyncEsbuildPlugin({ dest: packageJson.name }),

{
Expand Down

0 comments on commit 90336cd

Please sign in to comment.