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