Hatch plugin for JavaScript builds
A simple, extensible JS build plugin for hatch.
[tool.hatch.build.hooks.hatch-js]
path = "js"
install_cmd = "install"
build_cmd = "build"
tool = "pnpm"
targets = ["myproject/extension/cdn/index.js"]
See the test cases for more concrete examples.
hatch-js
is driven by pydantic models for configuration and execution of the build.
These models can themselves be overridden by setting build-config-class
/ build-plan-class
.
verbose = "false"
path = "path/to/js/root"
tool = "npm" # or pnpm, yarn, jlpm
install_cmd = "" # install command, defaults to `npm install`/`pnpm install`/`yarn`/`jlpm`
build_cmd = "build" # build command, defaults to `npm run build`/`pnpm run build`/`yarn build`/`jlpm build`
targets = [ # outputs to validate after build
"some/output.js"
]
Note
This library was generated using copier from the Base Python Project Template repository.