diff --git a/pack.config.js b/pack.config.js index b31d2d1..5cab75d 100644 --- a/pack.config.js +++ b/pack.config.js @@ -1,6 +1,6 @@ /** * - * @authors yutent (yutent@doui.cc) + * @authors yutent (yutent.io@gmail.com) * @date 2018-08-04 01:00:06 */ @@ -12,8 +12,9 @@ const path = require('path') const chokidar = require('chokidar') const uglify = require('uglify-es') const chalk = require('chalk') +const config = require('./package.json') const log = console.log -const VERSION = '2.0.0' +const VERSION = config.version const PACK_DIR = path.resolve('./dist') const SOURCE_DIR = path.resolve('./src/') @@ -59,9 +60,9 @@ export default _Anot function comment({ touch } = {}) { return `/*================================================== * Anot ${touch ? 'touch' : 'normal'} version for future browsers - * @authors yutent (yutent@doui.cc) - * @date 2017-03-21 21:05:57 - * V${VERSION} + * @authors yutent + * @date ${new Date().format()} + * @version v${VERSION} * ==================================================*/ ` @@ -115,8 +116,8 @@ function packNoCompress(file) { * 打包带触摸事件的未来版的 anot * -------------------------------------------------------- */ - fs.echo(Buffer.concat([PAD_START, touchVer, PAD_END]), './dist/anot-touch.js') - log('%s 打包完成...', chalk.green('anot-touch.js')) + fs.echo(Buffer.concat([PAD_START, touchVer, PAD_END]), './dist/anot.touch.js') + log('%s 打包完成...', chalk.green('anot.touch.js')) } // 打包并压缩 @@ -144,14 +145,14 @@ function packAndCompress() { * 打包带触摸事件的未来版的 anot * -------------------------------------------------------- */ - log('正在打包 anot-touch.js...') + log('正在打包 anot.touch.js...') let touchVerPack = Buffer.concat([PAD_START, touchVer, PAD_END]).toString() fs.echo( comment({ touch: true }) + uglify.minify(touchVerPack).code, - './dist/anot-touch.js' + './dist/anot.touch.js' ) - log(chalk.green('anot-touch.js 打包压缩完成!')) + log(chalk.green('anot.touch.js 打包压缩完成!')) } let args = process.argv.slice(2) diff --git a/package.json b/package.json index c27580b..bcff5a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anot", - "version": "2.2.2", + "version": "2.2.3", "description": "Anot - 迷你mvvm框架", "main": "dist/anot.js", "files": ["dist"], diff --git a/readme.md b/readme.md index 697e320..7715029 100644 --- a/readme.md +++ b/readme.md @@ -16,7 +16,7 @@ npm run prod ``` 执行完, 会打包为2个版本, 分别是 - anot.js 普通版(需要支持es6 module的现代浏览器) -- anot-touch.js 带触摸的版本(需要支持es6 module的现代浏览器) +- anot.touch.js 带触摸事件的版本(需要支持es6 module的现代浏览器) ### 文档: diff --git a/src/06-vm.js b/src/06-vm.js index 9818d0a..b840eb1 100644 --- a/src/06-vm.js +++ b/src/06-vm.js @@ -264,8 +264,8 @@ function observeObject(source, options) { return (old = value.get.call(this)) }, set: function(x) { - var older = old, - newer + var older = old + var newer value.set.call(this, x) newer = this[key] if (this.$fire && newer !== older) {