diff --git a/package.json b/package.json index 4254716..6679dd5 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "start": "parcel", "build": "yarn clean && parcel build --public-url ./", "clean": "rm -rf dist/", - "deploy": "yarn build && gh-pages -d dist" + "deploy": "yarn generateVersion && yarn build && gh-pages -d dist", + "generateVersion": "git rev-parse --short HEAD > assets/VERSION.txt" }, "devDependencies": { "autoprefixer": "^10.4.2", @@ -24,4 +25,4 @@ "wavefile": "^11.0.0", "wavesurfer.js": "^6.2.0" } -} +} \ No newline at end of file diff --git a/src/index.html b/src/index.html index 10ee441..76bfdb5 100644 --- a/src/index.html +++ b/src/index.html @@ -56,6 +56,8 @@

SHORTCUTS

diff --git a/src/index.js b/src/index.js index 2ddf60c..08c8596 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,7 @@ import Morphaweb from './Morphaweb' +import version from 'bundle-text:../assets/VERSION.txt' -const morphaweb = new Morphaweb() \ No newline at end of file +const morphaweb = new Morphaweb() + +const versionElement = document.getElementById('version') +versionElement.textContent = version \ No newline at end of file