Astro
The Astro plugin gives every package with an Astro config a build, dev, preview and check task, so a repository of Astro sites builds, caches, serves and checks them without a script for each.
Add it
Section titled “Add it”axle add astroThis writes it into the root axle.toml:
[plugins.astro]hash = "sha256-…"A package or project with an astro.config file, .mjs, .ts or another config extension, in its folder gets:
| Task | Command | Settings |
|---|---|---|
build |
astro build |
outputs the outDir, dist by default |
dev |
astro dev |
persistent, ready when Astro prints its Local address |
preview |
astro preview |
persistent, after the build |
check |
astro check |
outputs nothing |
Each command runs through the repository’s package manager, such as pnpm exec astro build, so it uses the version the package installs.
The output folder is read from the config without running it. When outDir is set to something other than a plain string, or to a folder outside the repository, the plugin leaves outputs out and Axle finds the outputs the build writes itself.
Scripts the repository already has
Section titled “Scripts the repository already has”A package’s own script wins. When its package.json has a script with a task’s name that runs something else, such as "dev": "astro dev --host", the plugin leaves that task alone and Axle runs the script. A script that runs the same command is replaced by the plugin’s task, which runs it and adds its settings. The repository’s axle.toml changes a task as it would any other, and wins over the plugin.
Settings
Section titled “Settings”| Setting | Default | Meaning |
|---|---|---|
build |
"build" |
the name of the build task, or false to leave it out |
dev |
"dev" |
the name of the dev server task, or false |
preview |
"preview" |
the name of the preview task, or false |
check |
"check" |
the name of the check task, or false |
The plugin’s answers are kept until an astro.config.*, a package.json, pnpm-workspace.yaml or a lockfile changes.