diff --git a/rollup.config.js b/rollup.config.js index 5b5da75..d03e92e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,18 +1,23 @@ const fs = require("fs"); const path = require("path"); const { execSync } = require("child_process"); -import svelte from "rollup-plugin-svelte"; import commonjs from "@rollup/plugin-commonjs"; import resolve from "@rollup/plugin-node-resolve"; +import css from "rollup-plugin-css-only"; import livereload from "rollup-plugin-livereload"; +import svelte from "rollup-plugin-svelte"; +import svg from "rollup-plugin-svg"; import { terser } from "rollup-plugin-terser"; import sveltePreprocess from "svelte-preprocess"; -import css from "rollup-plugin-css-only"; -import svg from "rollup-plugin-svg"; const production = !process.env.ROLLUP_WATCH; -const buildVersion = execSync("git rev-parse --short HEAD").toString(); +let buildVersion; +if (production) { + buildVersion = process.env.GIT_REV; // latest commit hash +} else { + buildVersion = execSync("git rev-parse --short HEAD").toString(); +} fs.writeFileSync( "build-info.js", "export default " +