From f737e4caca7183c87638f79d5c751c672f8e3a41 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Tue, 24 May 2022 14:37:56 -0500 Subject: [PATCH] fix: handle config.base for partytown --- packages/integrations/partytown/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/integrations/partytown/src/index.ts b/packages/integrations/partytown/src/index.ts index 45d91f84f4a0..789f974eb526 100644 --- a/packages/integrations/partytown/src/index.ts +++ b/packages/integrations/partytown/src/index.ts @@ -25,7 +25,7 @@ export default function createPlugin(options: PartytownOptions): AstroIntegratio name: '@astrojs/partytown', hooks: { 'astro:config:setup': ({ config: _config, command, injectScript }) => { - const lib = path.join(_config.base || '/', '~partytown'); + const lib = `${_config.base}~partytown/`; const forward = options?.config?.forward || []; const debug = options?.config?.debug || command === 'dev'; partytownSnippetHtml = partytownSnippet({ lib, debug, forward }); @@ -35,9 +35,10 @@ export default function createPlugin(options: PartytownOptions): AstroIntegratio config = _config; }, 'astro:server:setup': ({ server }) => { + const lib = `${config.base}~partytown/`; server.middlewares.use( sirv(partytownLibDirectory, { - mount: '/~partytown', + mount: lib, dev: true, etag: true, extensions: [],