Skip to content

Commit

Permalink
fix: handle config.base for partytown
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Moore committed May 24, 2022
1 parent b6d6a7a commit f737e4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/integrations/partytown/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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: [],
Expand Down

0 comments on commit f737e4c

Please sign in to comment.