This Astro integration adds Hyperscript.org to your project so that you can use Hyperscript.org anywhere on your page.
First, install the astro-hyperscript package using your package manager. If you're using npm or aren't sure, run this in the terminal:
npm install astro-hyperscript hyperscript.orgThen, apply this integration to your astro.config.* file using the integrations property:
// astro.config.mjs
import { defineConfig } from 'astro/config';
+ import hyperscript from 'astro-hyperscript';
export default defineConfig({
// ...
integrations: [hyperscript()],
// ^^^^^^^^
});Once the integration is installed, you can use hyperscript.org directives and syntax inside any Astro component. The Hyperscript.org script is automatically added and enabled on every page of your website.
Check Astro Integration Documentation for more on integrations.
The Hyperscript.org integration does not give you control over how the script is loaded or initialized. If you require this control, consider installing and using hyperscript.org manually. Astro supports all officially documented hyperscript.org manual setup instructions, using <script> tags inside of an Astro component.
---
// src/pages/index.astro
---
<!-- Example: Load hyperscript on a single page. -->
<script>
import "hyperscript.org";
</script>The hyperscript.org integration does not support any custom configuration at this time.
- The Astro Hyperscript example shows how to use Hyperscript in an Astro project.
This package is maintained by adamNewell. You're welcome to submit an issue or PR!