Last active
January 24, 2025 10:52
-
-
Save reggi/24d52508b466fb80e9516e0e99329091 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Plugin } from "$fresh/server.ts"; | |
const sources = [ | |
"https://raw.githubusercontent.com/bigskysoftware/htmx/dev/src/htmx.js", | |
"https://raw.githubusercontent.com/bigskysoftware/htmx/dev/src/ext/head-support.js" | |
] | |
export default function htmx(): Plugin { | |
const main = `data:application/javascript,${sources.map(s => `import "${s}";`).join('')} export default () => {}` | |
return { | |
name: "htmx", | |
entrypoints: { "main": main }, | |
render(ctx) { | |
ctx.render(); | |
return { | |
scripts: [{ entrypoint: "main", state: [] }], | |
}; | |
}, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment