sveltejs / kit

web development, streamlined
https://kit.svelte.dev
MIT License
17.81k stars 1.78k forks source link

feat: add %sveltekit.version% placeholder for template interpolation #12132

Open potch opened 1 month ago

potch commented 1 month ago

Allow app.html to interpolate the version string passed to kit.version.name in svelte.config.js. This makes it easier for static <head> includes for third-party scripts to be passed the current app version, e.g.

<script>
  GenericAnalytics.init({
    token: "abc123",
    application: "web",
    version: "%sveltekit.version%",
  });
</script>

This is nice ergonomic improvement, but there are several available workarounds:

This PR resolves https://github.com/sveltejs/kit/issues/12130.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

Tests

Changesets

Edits

changeset-bot[bot] commented 1 month ago

⚠️ No Changeset found

Latest commit: 649100730e7dd2346f6f2617207b9c74a441e6fa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR