Rspack
The Rspack plugin gives every package with an Rspack config a build task, and a dev task when the config has a dev server.
Add it
Section titled “Add it”axle add rspackThis writes it into the root axle.toml:
[plugins.rspack]hash = "sha256-…"A package or project with an rspack.config file, .ts, .mts, .cts, .js, .mjs or .cjs, in its folder gets:
| Task | Command | Settings |
|---|---|---|
build |
rspack build |
outputs the output folder |
dev |
rspack serve |
when the config has a devServer; persistent |
Each command runs through the repository’s package manager, such as pnpm exec rspack build, so it uses the version the package installs.
The output folder is output.path in the config, read without running it, and dist by default. When it is set to something other than a plain string, such as path.resolve(__dirname, 'out'), 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 "build": "rspack build --mode production", the plugin leaves that task alone and Axle runs the script. A script that only runs Rspack the way the plugin would, rspack build, rspack, rspack serve or rspack dev, is replaced by the plugin’s task, which runs the same command 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 |
[plugins.rspack]hash = "sha256-…"dev = falseThe plugin’s answers are kept until an rspack.config.*, a package.json, pnpm-workspace.yaml or a lockfile changes.