Compressor mode
- Compresses your website.This mode compresses your static website's.html
,.js
,.css
,.xml
,.svg
,.json
and.webmanifest
files.
It removes every comments, tabs and newlines.
For JavaScript it also compresses booleans and undefined:
true
->!0
false
->!1
undefined
->[][[]]
This mode is under development, and it may cause JavaScript and HTML errors!
To fix JavaScript, do not forget semicolons.
To fix HTML newlines, use<br>
instead.
Please report any bugsyou find.
This mode requires only the
just.config.js
file and the workflow file.just.config.js
JavaScript
module.exports = {
type: "compress"
}
.github/workflows/WORKFLOW_NAME.yml
YAML
name: Website
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Generate with _just
uses: js-just/latest@main
with:
path: . # Root directory, or you can replace the dot with the path to your website directory to be compressed.
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: . # Root directory, or you can replace the dot with the path to your entire website to be deployed to GitHub Pages.
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
How it works?
It compresses files by removing tabs, newlines and comments.Also it compresses booleans and undefined in JavaScript:
JavaScript
!0 // true
!1 // false
[][[]] // undefined
[][[]]
( undefined
) by JSFuck