From 6b42dacee81278294003ab7276c0fae9ff546b16 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Fri, 27 Oct 2023 11:54:41 +0200 Subject: [PATCH] fix(partytown): allow overriding the lib option (close #8760) (#8892) Co-authored-by: Sarah Rainsberger --- .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 0000000000000..a5acddde6c9bc --- /dev/null +++ b/.changeset/forty-eggs-raise.md @@ -0,0 +1,5 @@ +--- +'@astrojs/partytown': patch +--- + +Adds the ability to override the `lib` option in `astro.config.mjs` diff --git a/packages/integrations/partytown/src/index.ts b/packages/integrations/partytown/src/index.ts index 7550265123991..cfe1293c995d9 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);