diff --git a/package.json b/package.json index a3c7a0a..a843937 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "devDependencies": { "bannerify": "^1.0.1", "browserify": "^16.5.0", + "browserify-versionify": "^1.0.6", "mocha": "^6.2.0", "power-assert": "^1.6.1", "uglify-js": "^3.6.0", @@ -23,6 +24,11 @@ "build": "npm run compile && npm run minify", "test": "npm run build && mocha tests/test" }, + "browserify": { + "transform": [ + ["browserify-versionify", { "placeholder": "__VERSION__" }] + ] + }, "repository": { "type": "git", "url": "https://github.com/polygonplanet/encoding.js.git" diff --git a/src/index.js b/src/index.js index 8327042..1021b5f 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,7 @@ var KanaCaseTable = require('./kana-case-table'); var hasOwnProperty = Object.prototype.hasOwnProperty; var Encoding = { + version: '__VERSION__', /** * Encoding orders