Skip to content

Commit 617d456

Browse files
build: use version to setup build reproducibility (#595)
# Motivation We can use the version to setup build reproducibility and save few cycles when deploying to `gix.design`. # Changes - Setup version as we do in OISY or NNS Dapp or Juno --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent bb3a0e3 commit 617d456

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

svelte.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import adapter from "@sveltejs/adapter-static";
22
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
33
import { mdsvex } from "mdsvex";
4+
import { readFileSync } from "node:fs";
5+
import { fileURLToPath } from "node:url";
6+
7+
const file = fileURLToPath(new URL("package.json", import.meta.url));
8+
const json = readFileSync(file, "utf8");
9+
const { version } = JSON.parse(json);
410

511
/** @type {import('@sveltejs/kit').Config} */
612
const config = {
@@ -21,6 +27,9 @@ const config = {
2127
serviceWorker: {
2228
register: false,
2329
},
30+
version: {
31+
name: version,
32+
},
2433
},
2534
};
2635

0 commit comments

Comments
 (0)