From 2f8a7addb1c4dd54febccc3a416a8d2236200ddc Mon Sep 17 00:00:00 2001 From: Tony Samperi Date: Wed, 24 May 2023 19:58:29 +0200 Subject: [PATCH] MAINTENANCE * Add prepublishOnly to avoid version problems! --- package.json | 1 + test/test-dist.js | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 test/test-dist.js diff --git a/package.json b/package.json index b187a60..7f0727c 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "node": ">=13" }, "scripts": { + "prepublishOnly": "node ./test/test-dist.js", "build:watch": "rollup -c rollup.config.js -w", "build": "rollup -c rollup.config.js", "jest": "jest", diff --git a/test/test-dist.js b/test/test-dist.js new file mode 100644 index 0000000..b21b539 --- /dev/null +++ b/test/test-dist.js @@ -0,0 +1,7 @@ +(() => { + const tsLuxon = require("../dist/ts-luxon.umd"); + const pkg = require("../package.json"); + if(pkg.version !== tsLuxon.VERSION) { + throw new Error(`Version mismatch! Expected ${pkg.version}, got ${tsLuxon.VERSION}. Rebuild the package to solve!`); + } +})(); \ No newline at end of file