From 3f8b230016c55952b4e3a5fd89d50d78b3a29943 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 3 May 2016 13:34:43 -0400 Subject: [PATCH] add minified build --- package.json | 3 ++- vue-touch.min.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 vue-touch.min.js diff --git a/package.json b/package.json index 2ca45e1..092513a 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,12 @@ "hammerjs": "^2.0.6" }, "devDependencies": { + "uglify-js": "^2.6.2", "vue": "^1.0.16", "webpack": "^1.12.12" }, "scripts": { - "build": "webpack example/example.js example/example.build.js", + "build": "webpack example/example.js example/example.build.js && uglifyjs vue-touch.js -c -m > vue-touch.min.js", "dev": "webpack --watch example/example.js example/example.build.js" } } diff --git a/vue-touch.min.js b/vue-touch.min.js new file mode 100644 index 0000000..c7fea0d --- /dev/null +++ b/vue-touch.min.js @@ -0,0 +1 @@ +!function(){function e(e){return e.charAt(0).toUpperCase()+e.slice(1)}function t(e){var t=e.direction;if("string"==typeof t){var i="DIRECTION_"+t.toUpperCase();o.indexOf(t)>-1&&r.hasOwnProperty(i)?e.direction=r[i]:console.warn("[vue-touch] invalid direction: "+t)}}var i={},r="function"==typeof require?require("hammerjs"):window.Hammer,n=["tap","pan","pinch","press","rotate","swipe"],o=["up","down","left","right","horizontal","vertical","all"],a={};if(!r)throw new Error("[vue-touch] cannot locate Hammer.js.");i.config={},i.install=function(o){o.directive("touch",{isFn:!0,acceptStatement:!0,priority:o.directive("on").priority,bind:function(){this.el.hammer||(this.el.hammer=new r.Manager(this.el));var o=this.mc=this.el.hammer,s=this.arg;s||console.warn("[vue-touch] event type argument is required.");var h,c;if(a[s]){var u=a[s];h=u.type,c=new(r[e(h)])(u),c.recognizeWith(o.recognizers),o.add(c)}else{for(var d=0;d