mirror of
https://github.com/withastro/astro.git
synced 2025-03-24 23:21:57 -05:00
fix: handling config that provides a base but no site
This commit is contained in:
parent
d8f02be588
commit
326aced56a
1 changed files with 5 additions and 3 deletions
|
@ -176,9 +176,11 @@ async function generatePath(
|
||||||
|
|
||||||
debug('build', `Generating: ${pathname}`);
|
debug('build', `Generating: ${pathname}`);
|
||||||
|
|
||||||
const site = !astroConfig.base || astroConfig.base === './'
|
// If a base path was provided, append it to the site URL. This ensures that
|
||||||
? astroConfig.site
|
// all injected scripts and links are referenced relative to the site and subpath.
|
||||||
: joinPaths(astroConfig.site, astroConfig.base);
|
const site = astroConfig.base && astroConfig.base !== './'
|
||||||
|
? joinPaths(astroConfig.site || 'http://localhost/', astroConfig.base)
|
||||||
|
: astroConfig.site;
|
||||||
const links = createLinkStylesheetElementSet(linkIds.reverse(), site);
|
const links = createLinkStylesheetElementSet(linkIds.reverse(), site);
|
||||||
const scripts = createModuleScriptElementWithSrcSet(hoistedId ? [hoistedId] : [], site);
|
const scripts = createModuleScriptElementWithSrcSet(hoistedId ? [hoistedId] : [], site);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue