diff --git a/pyproject.toml b/pyproject.toml index ce5d6bcc..18b99087 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,3 +91,6 @@ exclude = [ [tool.hatch.build.hooks.vcs] version-file = "src/pytest_html/__version.py" + +[tool.hatch.build.hooks.custom] +path = "scripts/npm.py" diff --git a/scripts/npm.py b/scripts/npm.py new file mode 100644 index 00000000..4624e69c --- /dev/null +++ b/scripts/npm.py @@ -0,0 +1,9 @@ +import subprocess + +from hatchling.builders.hooks.plugin.interface import BuildHookInterface + + +class NpmBuildHook(BuildHookInterface): + def initialize(self, version, build_data): + subprocess.check_output("npm install", shell=True) + subprocess.check_output("npm run build", shell=True)