mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
fix(cloudflare): base strip logic (#6550)
This commit is contained in:
parent
ff5f1e89a1
commit
2c829fdf65
2 changed files with 6 additions and 1 deletions
5
.changeset/early-kangaroos-invent.md
Normal file
5
.changeset/early-kangaroos-invent.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/cloudflare': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix `config.base` trimming logic for cloudflare integration `_routes.json` generation
|
|
@ -156,7 +156,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
|
||||||
let pagePath = prependForwardSlash(page.pathname);
|
let pagePath = prependForwardSlash(page.pathname);
|
||||||
if (_config.base !== '/') {
|
if (_config.base !== '/') {
|
||||||
const base = _config.base.endsWith('/')
|
const base = _config.base.endsWith('/')
|
||||||
? _config.base.substring(0, -1)
|
? _config.base.slice(0, -1)
|
||||||
: _config.base;
|
: _config.base;
|
||||||
pagePath = `${base}${pagePath}`;
|
pagePath = `${base}${pagePath}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue