Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johannschopplich/hashup
🔢 CLI to hash your Kirby build assets
https://github.com/johannschopplich/hashup
hashing kirby kirby-cms
Last synced: 2 months ago
JSON representation
🔢 CLI to hash your Kirby build assets
- Host: GitHub
- URL: https://github.com/johannschopplich/hashup
- Owner: johannschopplich
- License: mit
- Created: 2021-11-24T13:48:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-04T06:14:46.000Z (3 months ago)
- Last Synced: 2024-10-15T01:21:30.556Z (3 months ago)
- Topics: hashing, kirby, kirby-cms
- Language: TypeScript
- Homepage: https://github.com/johannschopplich/kirby-hashed-assets
- Size: 311 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hashup
> [!TIP]
> Mainly to use in conjunction with [kirby-hashed-assets](https://github.com/johannschopplich/kirby-hashed-assets).`hashup` is a tiny CLI tool with two objectives in mind for your freshly built frontend assets:
1. Rename or rather hash (hence the name) the assets.
2. Generate a `manifest.json` for them.## Installation
If you want to use hashup right away, there is no need to install it. Simply call it with `npx`:
```bash
npx -y hashup
```Otherwise, add it to your development dependencies with either `npm`, `pnpm` or your package manager of choice:
```bash
# pnpm
pnpm add -D hashup# npm
npm i -D hashup
```## Usage
Add hashup to your build pipeline by adding it your `package.json` scripts (recommended), for example:
```json
{
"scripts": {
"clean": "rm -rf public/assets/{css,js}",
"build": "npm run clean && <...> && hashup"
},
"devDependencies": {
"hashup": "latest"
}
}
```Now, pass asset paths to Kirby's asset helpers like you normally do:
```php
= js('assets/js/main.js') ?>
// `
```Read on here: [Automatic hashing with `manifest.json`](https://github.com/johannschopplich/kirby-hashed-assets#automatic-hashing-with-manifestjson).
## License
[MIT](./LICENSE) License © 2021-PRESENT [Johann Schopplich](https://github.com/johannschopplich)