Hatch plugin for JavaScript builds
Project Links
Meta
Author: the hatch-js authors
Requires Python: >=3.10
Classifiers
Development Status
- 3 - Alpha
License
- OSI Approved :: Apache Software License
Programming Language
- Python
- Python :: 3
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
- Python :: Implementation :: CPython
- Python :: Implementation :: PyPy
hatch js
Hatch plugin for JavaScript builds
Overview
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.
Configuration
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.