Skip to content

Metadrop/ddev-unlighthouse

Repository files navigation

tests project is maintained GitHub Release

What is DDEV Unlighthouse Add-on?

This is a DDEV addon to run Unlighthouse in your site. Unlighthouse is a tool to scan your entire site with Google Lighthouse in 2 minutes (on average).

This is optimized for Aljibe projects, but can be used in any DDEV project.

Getting Started

Install this addon:

For DDEV v1.23.5 or above run

ddev add-on get Metadrop/ddev-unlighthouse

For earlier versions of DDEV run

ddev get Metadrop/ddev-unlighthouse

Once installed, make sure to restart your ddev project:

ddev restart

Configuration

This addon uses the tests/[local|pro|....]/unlighthouse.ts configuration file to customize tests according to your needs. You can modify this file following Unlighthouse configuration guidelines.

Running Tests

To execute unlighthouse tests, simply access your ddev environment and run any of this commands:

  • unlighthouse: Run tests and browse them live at https://$DDEV_HOSTNAME:5678
  • unlighthouse-ci: Run tests and generate a static report in reports/unlighthouse folder

ddev [unlighthouse|unlighthouse-ci] <folder>[local|pre|pro...]

Accessing reports

Because of CORS restrictions, reports must be accessed via an HTTP server. To do this, you need to adjust the unlighthouse configuration and provide ddev's URL. See unlighthouse/unlighthouse.ts for reference.

Interpreting Results

Once unlighthouse reports are generated, you can review them to identify areas for improvement in performance, accessibility, and more of your website.

Happy optimization!

Image version

This addon uses a Docker image from docker-aljibe-tools with a combined tag that encodes both the Unlighthouse version and the base image version:

ghcr.io/metadrop/aljibe-tools/unlighthouse:0.17.2-base1.0.0

The default version is set in docker-compose.unlighthouse.yaml. To use a different version, add the following to .ddev/.env:

UNLIGHTHOUSE_VERSION=0.17.2-base1.0.0

To update to a newer version, reinstall the addon with ddev add-on get Metadrop/ddev-unlighthouse or update UNLIGHTHOUSE_VERSION in .ddev/.env and run ddev restart.

Available versions are listed in the docker-aljibe-tools packages.

Contributed and maintained by @Metadrop

About

Unlighthouse service for Aljibe

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Generated from ddev/ddev-addon-template