From 02ccc30e230d54005e3c597386b921f088b41152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Mon, 27 Jul 2020 15:20:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=89=93=E5=8C=85=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pack.config.js | 21 +++++++++++---------- package.json | 2 +- readme.md | 2 +- src/06-vm.js | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) 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) {