From aab1300dedc1a9da2d4f4d9cd7d951ee53c17c79 Mon Sep 17 00:00:00 2001 From: 06wj <06wj@163.com> Date: Thu, 26 May 2016 18:00:35 +0800 Subject: [PATCH] feat: add Hilo.version --- gulpfile.js | 3 +++ src/core/Hilo.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index 89e93053..19c3caa5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -51,6 +51,9 @@ var createBuildFormatTask = function(type){ cwd:pkg.sources.dir, base:pkg.sources.dir }) + .pipe(gulpif(function(file){ + return file.path.indexOf('Hilo.js') > -1; + }, replace('{{$version}}', pkg.version))) .pipe(replace(licenseCommentReg, '')) .pipe(replace(apiCommentReg, '$1')) .pipe(transformModule(type)) diff --git a/src/core/Hilo.js b/src/core/Hilo.js index 7a57429f..7ea4426d 100644 --- a/src/core/Hilo.js +++ b/src/core/Hilo.js @@ -23,6 +23,11 @@ var win = window, doc = document, docElem = doc.documentElement, uid = 0; return { + /** + * Hilo version + * @type String + */ + version:'{{$version}}', /** * @language=en * Gets a globally unique id. Such as Stage1, Bitmap2 etc.