From ddbd9c50deab496e0127c8c27109f0f47db1b24f Mon Sep 17 00:00:00 2001 From: Florian LEFEBVRE Date: Mon, 23 Oct 2023 08:57:00 +0200 Subject: [PATCH 1/2] fix(partytown): allow overriding the lib option (close #8760) --- .changeset/forty-eggs-raise.md | 5 +++++ packages/integrations/partytown/src/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/forty-eggs-raise.md diff --git a/.changeset/forty-eggs-raise.md b/.changeset/forty-eggs-raise.md new file mode 100644 index 000000000000..0278a97d031b --- /dev/null +++ b/.changeset/forty-eggs-raise.md @@ -0,0 +1,5 @@ +--- +'@astrojs/partytown': patch +--- + +Allows overriding the `lib` option diff --git a/packages/integrations/partytown/src/index.ts b/packages/integrations/partytown/src/index.ts index 755026512399..cfe1293c995d 100644 --- a/packages/integrations/partytown/src/index.ts +++ b/packages/integrations/partytown/src/index.ts @@ -27,8 +27,8 @@ export default function createPlugin(options?: PartytownOptions): AstroIntegrati 'astro:config:setup': ({ config: _config, command, injectScript }) => { const lib = `${appendForwardSlash(_config.base)}~partytown/`; const partytownConfig = { - ...options?.config, lib, + ...options?.config, debug: options?.config?.debug ?? command === 'dev', }; partytownSnippetHtml = partytownSnippet(partytownConfig); From af6f0236c8a0d8068157f6cf9538091ef87cf281 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Mon, 23 Oct 2023 15:03:04 +0200 Subject: [PATCH 2/2] Update .changeset/forty-eggs-raise.md Co-authored-by: Sarah Rainsberger --- .changeset/forty-eggs-raise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/forty-eggs-raise.md b/.changeset/forty-eggs-raise.md index 0278a97d031b..a5acddde6c9b 100644 --- a/.changeset/forty-eggs-raise.md +++ b/.changeset/forty-eggs-raise.md @@ -2,4 +2,4 @@ '@astrojs/partytown': patch --- -Allows overriding the `lib` option +Adds the ability to override the `lib` option in `astro.config.mjs`