summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Junya Kono <junya03dance@gmail.com> 2023-01-19 22:12:37 +0900
committerGravatar GitHub <noreply@github.com> 2023-01-19 08:12:37 -0500
commit899214298cee5f0c975c7245e623c649e1842d73 (patch)
treedf6cf7fc31728cdb765e642ec30fd13ec7fdfc89
parent35b26f377f9f379207fb4b5c16877bad1661ac6b (diff)
downloadastro-899214298cee5f0c975c7245e623c649e1842d73.tar.gz
astro-899214298cee5f0c975c7245e623c649e1842d73.tar.zst
astro-899214298cee5f0c975c7245e623c649e1842d73.zip
fix(astro/core): Do not automatically add trailing slash (#5608)
* fix: Do not automatically add trailing slash * Update .changeset/twelve-cooks-tickle.md Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> * fix: change semver Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
-rw-r--r--.changeset/twelve-cooks-tickle.md5
-rw-r--r--packages/astro/src/core/config/schema.ts6
2 files changed, 6 insertions, 5 deletions
diff --git a/.changeset/twelve-cooks-tickle.md b/.changeset/twelve-cooks-tickle.md
new file mode 100644
index 000000000..bf1bf5b8a
--- /dev/null
+++ b/.changeset/twelve-cooks-tickle.md
@@ -0,0 +1,5 @@
+---
+'astro': major
+---
+
+A trailing slash will not be automatically appended to `import.meta.env.SITE`. Instead, it will be the value of the `site` config as is. This may affect usages of `${import.meta.env.SITE}image.png`, which will need to be updated accordingly.
diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts
index eff69ca4a..69380ee77 100644
--- a/packages/astro/src/core/config/schema.ts
+++ b/packages/astro/src/core/config/schema.ts
@@ -57,11 +57,7 @@ export const AstroConfigSchema = z.object({
.optional()
.default(ASTRO_CONFIG_DEFAULTS.outDir)
.transform((val) => new URL(val)),
- site: z
- .string()
- .url()
- .optional()
- .transform((val) => (val ? appendForwardSlash(val) : val)),
+ site: z.string().url().optional(),
base: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.base),
trailingSlash: z
.union([z.literal('always'), z.literal('never'), z.literal('ignore')])