https://github.com/python-project-templates/hatch-js
Hatch plugin for JavaScript
https://github.com/python-project-templates/hatch-js
build-tool hatch hatchling javascript python
Last synced: 9 days ago
JSON representation
Hatch plugin for JavaScript
- Host: GitHub
- URL: https://github.com/python-project-templates/hatch-js
- Owner: python-project-templates
- License: apache-2.0
- Created: 2024-07-09T18:42:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-02-15T06:04:15.000Z (21 days ago)
- Last Synced: 2026-02-15T12:52:33.665Z (21 days ago)
- Topics: build-tool, hatch, hatchling, javascript, python
- Language: Python
- Homepage:
- Size: 57.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# hatch js
Hatch plugin for JavaScript builds
[](https://github.com/python-project-templates/hatch-js/actions/workflows/build.yaml)
[](https://codecov.io/gh/python-project-templates/hatch-js)
[](https://github.com/python-project-templates/hatch-js)
[](https://pypi.python.org/pypi/hatch-js)
## Overview
A simple, extensible JS build plugin for [hatch](https://hatch.pypa.io/latest/).
```toml
[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](./hatch_js/tests/) for more concrete examples.
`hatch-js` is driven by [pydantic](https://docs.pydantic.dev/latest/) models for configuration and execution of the build.
These models can themselves be overridden by setting `build-config-class` / `build-plan-class`.
## Configuration
```toml
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](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).