[ci] format

This commit is contained in:
natemoo-re 2022-05-16 18:32:54 +00:00 committed by github-actions[bot]
parent 31b0bc87a4
commit 58cca31e79

View file

@ -7,12 +7,14 @@ import { createRequire } from 'module';
import path from 'path'; import path from 'path';
const resolve = createRequire(import.meta.url).resolve; const resolve = createRequire(import.meta.url).resolve;
type PartytownOptions = { type PartytownOptions =
| {
config?: { config?: {
forward?: string[]; forward?: string[];
debug?: boolean; debug?: boolean;
};
} }
} | undefined; | undefined;
export default function createPlugin(options: PartytownOptions): AstroIntegration { export default function createPlugin(options: PartytownOptions): AstroIntegration {
let config: AstroConfig; let config: AstroConfig;
@ -23,8 +25,8 @@ export default function createPlugin(options: PartytownOptions): AstroIntegratio
name: '@astrojs/partytown', name: '@astrojs/partytown',
hooks: { hooks: {
'astro:config:setup': ({ config: _config, command, injectScript }) => { 'astro:config:setup': ({ config: _config, command, injectScript }) => {
const forward = options?.config?.forward || [] const forward = options?.config?.forward || [];
const debug = options?.config?.debug || command === 'dev' const debug = options?.config?.debug || command === 'dev';
partytownSnippetHtml = partytownSnippet({ debug, forward }); partytownSnippetHtml = partytownSnippet({ debug, forward });
injectScript('head-inline', partytownSnippetHtml); injectScript('head-inline', partytownSnippetHtml);
}, },