From c5ff46a87a57915422d4c36254cce80bfdf5578d Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Tue, 8 Sep 2015 14:01:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0grunt-dist=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=8E=8B=E7=BC=A9=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Gruntfile.coffee | 5 +++++ README.md | 26 +++++++++++++++++++------- package.json | 3 ++- test/test.html | 17 ++++++++++++++++- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index c2658d7..b947077 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +dist/ diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 97ea7ee..77e1c2e 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -2,6 +2,7 @@ module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-jshint' + grunt.loadNpmTasks 'grunt-dist' grunt.initConfig( pkg: grunt.file.readJSON 'package.json' uglify: @@ -19,6 +20,10 @@ module.exports = (grunt) -> eqeqeq: true trailing: true files: ['src/hotkeys.js'] + dist: + default_options: + files: + "dist":['src/hotkeys.js'] watch: another: files: ['src/*.js'] diff --git a/README.md b/README.md index 4866928..2d02eef 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,29 @@ [![](https://img.shields.io/github/issues/jaywcjlove/hotkeys.svg)](https://github.com/jaywcjlove/hotkeys/issues) [![](https://img.shields.io/github/forks/jaywcjlove/hotkeys.svg)](https://github.com/jaywcjlove/hotkeys/network) [![](https://img.shields.io/github/stars/jaywcjlove/hotkeys.svg)](https://github.com/jaywcjlove/hotkeys/stargazers) [![](https://img.shields.io/github/release/jaywcjlove/hotkeys.svg)](https://github.com/jaywcjlove/hotkeys/releases) -这又是在重复造轮子,呵呵~!! +自定义快捷键没有依赖。这又是在重复造轮子,呵呵~!! -## 下载 +## 创建 -### bower -Run `bower info hotkeysjs` to list the available versions. -下载 `bower install hotkeysjs` +您将需要在您的系统上安装的 Node.js。 + +```sh +# npm 安装 +$ bower install hotkeysjs + +# npm 安装 +$ npm install hotkeys-js + +# 在页面上引用需要压缩的话,运行 +$ grunt dist + +# 在dist目录中生成下列文件: +# dist/hotkeys.js +# dist/hotkeys.min.js +# dist/hotkeys.min.map +``` -### npm -下载 `npm install hotkeys-js` ## 定义快捷键 diff --git a/package.json b/package.json index 8e92174..80ddf9a 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "grunt": "^0.4.5", "grunt-contrib-jshint": "^0.11.2", "grunt-contrib-uglify": "^0.9.1", - "grunt-contrib-watch": "^0.6.1" + "grunt-contrib-watch": "^0.6.1", + "grunt-dist": "0.0.3" } } diff --git a/test/test.html b/test/test.html index ab2d394..b6f9195 100644 --- a/test/test.html +++ b/test/test.html @@ -6,6 +6,21 @@ - + +
+ \ No newline at end of file