Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compress script to apply gzip to assets not packed by webpack #658

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

1000TurquoisePogs
Copy link
Member

When v3 was made, the build script of the desktop changed from webpack to angular-cli.
As a result, our compression plugin is no longer used, and assets in the web folder do not get compressed.

Given that the command "gzip" is universally available on unix environments, I just created a node program that recursively goes through the web folder and runs "gzip" if a file is under a certain size limit and over a certain minimum size.
If the resulting gzip file isn't meaningfully smaller, it is removed. If it is small enough, the original file is removed.

The result is that this script can compress web folder contents without adding some npm library dependency.

To use this, it must be added to a build script.

Use as:

npm install
npm run build
npm run compress

Signed-off-by: 1000TurquoisePogs <[email protected]>
@1000TurquoisePogs 1000TurquoisePogs merged commit 2fd7da2 into v3.x/staging Jan 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants