From f226acebe4ed2f02fe33f4555c878b7bab9df497 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Thu, 20 Feb 2025 12:46:30 +0100 Subject: [PATCH 1/2] build: use version to setup build reproducibility --- svelte.config.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/svelte.config.js b/svelte.config.js index 2880a750..6db26378 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,6 +1,12 @@ import adapter from "@sveltejs/adapter-static"; import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; import { mdsvex } from "mdsvex"; +import {fileURLToPath} from "node:url"; +import {readFileSync} from "node:fs"; + +const file = fileURLToPath(new URL('package.json', import.meta.url)); +const json = readFileSync(file, 'utf8'); +const { version } = JSON.parse(json); /** @type {import('@sveltejs/kit').Config} */ const config = { @@ -21,6 +27,9 @@ const config = { serviceWorker: { register: false, }, + version: { + name: version + } }, }; From d9709f873df1fdddb7df858c578f11c05bebdbc6 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 11:48:06 +0000 Subject: [PATCH 2/2] Updating formatting --- svelte.config.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/svelte.config.js b/svelte.config.js index 6db26378..2fad7fb1 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,11 +1,11 @@ import adapter from "@sveltejs/adapter-static"; import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; import { mdsvex } from "mdsvex"; -import {fileURLToPath} from "node:url"; -import {readFileSync} from "node:fs"; +import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; -const file = fileURLToPath(new URL('package.json', import.meta.url)); -const json = readFileSync(file, 'utf8'); +const file = fileURLToPath(new URL("package.json", import.meta.url)); +const json = readFileSync(file, "utf8"); const { version } = JSON.parse(json); /** @type {import('@sveltejs/kit').Config} */ @@ -28,8 +28,8 @@ const config = { register: false, }, version: { - name: version - } + name: version, + }, }, };