@astrojs/preact
Advanced tools
Comparing version 0.0.0-10745-20240410180016 to 0.0.0-actions-20240503212851
import { type PreactPluginOptions as VitePreactPluginOptions } from '@preact/preset-vite'; | ||
import type { AstroIntegration } from 'astro'; | ||
export type Options = Pick<VitePreactPluginOptions, 'include' | 'exclude'> & { | ||
export interface Options extends Pick<VitePreactPluginOptions, 'include' | 'exclude'> { | ||
compat?: boolean; | ||
}; | ||
export default function ({ include, exclude, compat }?: Options): AstroIntegration; | ||
devtools?: boolean; | ||
} | ||
export default function ({ include, exclude, compat, devtools }?: Options): AstroIntegration; |
@@ -11,7 +11,7 @@ import { fileURLToPath } from "node:url"; | ||
} | ||
function src_default({ include, exclude, compat } = {}) { | ||
function src_default({ include, exclude, compat, devtools } = {}) { | ||
return { | ||
name: "@astrojs/preact", | ||
hooks: { | ||
"astro:config:setup": ({ addRenderer, updateConfig, command }) => { | ||
"astro:config:setup": ({ addRenderer, updateConfig, command, injectScript }) => { | ||
const preactPlugin = preact({ | ||
@@ -49,2 +49,5 @@ reactAliasesEnabled: compat ?? false, | ||
}); | ||
if (command === "dev" && devtools) { | ||
injectScript("page", 'import "preact/debug";'); | ||
} | ||
} | ||
@@ -51,0 +54,0 @@ } |
{ | ||
"name": "@astrojs/preact", | ||
"description": "Use Preact components within Astro", | ||
"version": "0.0.0-10745-20240410180016", | ||
"version": "0.0.0-actions-20240503212851", | ||
"type": "module", | ||
@@ -33,6 +33,6 @@ "types": "./dist/index.d.ts", | ||
"dependencies": { | ||
"@babel/plugin-transform-react-jsx": "^7.22.5", | ||
"@babel/plugin-transform-react-jsx": "^7.23.4", | ||
"@babel/plugin-transform-react-jsx-development": "^7.22.5", | ||
"@preact/preset-vite": "^2.7.0", | ||
"@preact/signals": "^1.2.1", | ||
"@preact/preset-vite": "^2.8.2", | ||
"@preact/signals": "^1.2.3", | ||
"babel-plugin-transform-hook-names": "^1.0.2", | ||
@@ -43,4 +43,4 @@ "preact-render-to-string": "~6.3.1", | ||
"devDependencies": { | ||
"preact": "^10.19.2", | ||
"astro": "0.0.0-10745-20240410180016", | ||
"preact": "^10.20.2", | ||
"astro": "0.0.0-actions-20240503212851", | ||
"astro-scripts": "0.0.14" | ||
@@ -47,0 +47,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17781
337