Skip to content

Commit

Permalink
fix(astro/core): Do not automatically add trailing slash (#5608)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
konojunya and bluwy committed Jan 19, 2023
1 parent 35b26f3 commit 8992142
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-cooks-tickle.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 1 addition & 5 deletions packages/astro/src/core/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')])
Expand Down

0 comments on commit 8992142

Please sign in to comment.