Skip to content
Content is incomplete and some pages may be missing or low quality. Check back soon for updates.

Installation

There are two ways to get started with GhettoCDN, depending on whether you want to add it to an existing project or start fresh with a fully scaffolded application.

Install the GhettoCDN package using your preferred package manager:

Terminal window
pnpm add ghettocdn --allow-build=ghettocdn

Next, create a configuration file named ghettocdn.config.yaml at the root of your project. This is where you will run all GhettoCDN commands from.

The example config below provides a sensible set of defaults to get you started:

ghettocdn.config.yaml
asset_dir: assets
dist_dir: dist
processing:
# Auto-scale worker threads based on CPU
jobs: 0
input:
# Include common web + app asset types
formats:
- .png
- .jpg
- .jpeg
- .webp
- .gif
- .svg
- .json
- .yaml
- .yml
- .woff2
- .woff
- .mp4
- .webm
output:
- Images:
- .webp
- .jpg
- .png
- Animations:
- .gif
transform:
- Animations
- Images
- YAML
- JSON

Once your configuration is in place, create your asset directory and you’re ready to start building assets.

To learn more about the config and what each field means you can check out our configuration documentation here.

To generate a new GhettoCDN project from the scaffold, use the create command of your package manager. This will load the scaffold package and ask you a few questions to customise your project.

Terminal window
pnpm create ghettocdn --allow-build=ghettocdn

Once complete, your project should look like this:

  • Directorymy-ghettocdn-app
    • ghettocdn.config.yaml GhettoCDN config file
    • .gitignore
    • Directoryassets
      • .gitkeep
    • README.md
    • package.json

If you chose not to install dependencies during scaffolding, you’ll need to install them before you can use GhettoCDN. If you’re using pnpm, either pass the --allow-build flag or run pnpm approve-builds after install and approve GhettoCDN.

Your GhettoCDN project is set up and ready to go. Start building assets!