[ci] format
This commit is contained in:
parent
31b0bc87a4
commit
58cca31e79
1 changed files with 10 additions and 8 deletions
|
@ -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?: {
|
| {
|
||||||
forward?: string[];
|
config?: {
|
||||||
debug?: boolean;
|
forward?: string[];
|
||||||
}
|
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);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue