From ffd97374e80c65d18a5d8a21c97d2121880c2314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20G=C3=A4rtner?= Date: Wed, 30 Dec 2015 01:20:49 +0100 Subject: [PATCH] feat: Add version to dTree #14 --- gulpfile.js | 1 + package.json | 1 + src/dtree.js | 2 ++ 3 files changed, 4 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index 080ea87..ba69261 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -77,6 +77,7 @@ gulp.task('build', ['lint-src', 'clean'], function(done) { }); $.file(exportFileName + '.js', res.code, { src: true }) + .pipe($.preprocess({context: {DTREE_VERSION: manifest.version}})) .pipe($.plumber()) .pipe($.sourcemaps.init({ loadMaps: true })) .pipe($.babel()) diff --git a/package.json b/package.json index 10b25ee..028d221 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "gulp-bump": "^1.0.0", "gulp-conventional-changelog": "^0.7.0", "gulp-git": "^1.5.0", + "gulp-preprocess": "^2.0.0", "minimist": "^1.2.0", "isparta": "~3.0.3", "jquery": "^2.1.4", diff --git a/src/dtree.js b/src/dtree.js index 40e05a6..b4f111e 100644 --- a/src/dtree.js +++ b/src/dtree.js @@ -2,6 +2,8 @@ import TreeBuilder from './builder.js'; const dTree = { + version: '/* @echo DTREE_VERSION */', + init: function(data, options = {}) { var opts = _.defaultsDeep(options || {}, {