mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
fix: 🩹 update partytown options ts type (#7175)
This commit is contained in:
parent
dc31b8a722
commit
59d8c50b84
2 changed files with 9 additions and 6 deletions
5
.changeset/curvy-hotels-study.md
Normal file
5
.changeset/curvy-hotels-study.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/partytown': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix typescript type for partytown options
|
|
@ -9,17 +9,15 @@ import { fileURLToPath } from 'url';
|
||||||
import sirv from './sirv.js';
|
import sirv from './sirv.js';
|
||||||
const resolve = createRequire(import.meta.url).resolve;
|
const resolve = createRequire(import.meta.url).resolve;
|
||||||
|
|
||||||
type PartytownOptions =
|
type PartytownOptions = {
|
||||||
| {
|
config?: PartytownConfig;
|
||||||
config?: PartytownConfig;
|
};
|
||||||
}
|
|
||||||
| undefined;
|
|
||||||
|
|
||||||
function appendForwardSlash(str: string) {
|
function appendForwardSlash(str: string) {
|
||||||
return str.endsWith('/') ? str : str + '/';
|
return str.endsWith('/') ? str : str + '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function createPlugin(options: PartytownOptions): AstroIntegration {
|
export default function createPlugin(options?: PartytownOptions): AstroIntegration {
|
||||||
let config: AstroConfig;
|
let config: AstroConfig;
|
||||||
let partytownSnippetHtml: string;
|
let partytownSnippetHtml: string;
|
||||||
const partytownEntrypoint = resolve('@builder.io/partytown/package.json');
|
const partytownEntrypoint = resolve('@builder.io/partytown/package.json');
|
||||||
|
|
Loading…
Reference in a new issue