UNPKG

wf-components

Version:

This is the official component library for the Wireshark website, made by the Wireshark Foundation. It's currently a work in progress and will be updated regularly.

31 lines (29 loc) 722 B
import type { AstroIntegration } from 'astro' import type { PluginOption } from 'vite' import tailwindcss from 'tailwindcss'; interface Config { css?: string } export default function wfComponentsIntegration( config: Partial<Config> | undefined ): AstroIntegration { return { name: '/integration', hooks: { 'astro:config:setup': async ({ updateConfig, injectScript, }) => { updateConfig({ vite: { plugins: [tailwindcss() as PluginOption] } }) // ---------------------- // Inject css // ---------------------- config?.css && injectScript('page-ssr', `import "${config?.css}";`) }, }, } }