summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Loach <robloach@gmail.com>2014-11-18 04:49:03 -0500
committerRob Loach <robloach@gmail.com>2014-11-18 04:49:03 -0500
commit4e47cb9089340aa069e94fa1bf8ee6886d3b780a (patch)
tree15a2ccba6644c736627347f8c2a3c3e257e3ed06
parent03027a958db2e5af6c49156f97b8879cdc612a65 (diff)
downloadjquery-once-4e47cb9089340aa069e94fa1bf8ee6886d3b780a.zip
jquery-once-4e47cb9089340aa069e94fa1bf8ee6886d3b780a.tar.gz
jquery-once-4e47cb9089340aa069e94fa1bf8ee6886d3b780a.tar.bz2
Remove dependency on Grunt for eslint and uglifyjs
-rw-r--r--Gruntfile.js27
-rw-r--r--README.md6
-rw-r--r--jquery.once.js10
-rw-r--r--jquery.once.min.js12
-rw-r--r--jquery.once.min.js.map1
-rw-r--r--package.json12
6 files changed, 22 insertions, 46 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 3c7201b..af1d6f7 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -3,40 +3,15 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
- uglify: {
- options: {
- preserveComments: false,
- banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
- '<%= grunt.template.today("m/d/yyyy") %>' +
- '<%= pkg.homepage ? " - " + pkg.homepage + "\\n" : "" %>' +
- ' * (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
- ' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n'
- },
- all: {
- files: {
- 'jquery.once.min.js': [
- 'jquery.once.js'
- ]
- }
- }
- },
qunit: {
files: [
'test/index.html'
]
- },
- eslint: {
- target: [
- 'jquery.once.js'
- ]
}
});
grunt.loadNpmTasks('grunt-contrib-qunit');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-eslint');
- grunt.registerTask('default', ['eslint', 'qunit']);
- grunt.registerTask('release', ['default', 'uglify']);
+ grunt.registerTask('default', ['qunit']);
};
diff --git a/README.md b/README.md
index e1b04e6..80ae96b 100644
--- a/README.md
+++ b/README.md
@@ -110,9 +110,9 @@ Use [Grunt](http://gruntjs.com) to run [qunit](http://qunitjs.com) tests:
grunt jshint qunit
-Build the project with [Grunt](http://gruntjs.com):
+Build the project with:
- grunt release
+ npm run-script release
Update project documentation with [Projectz](https://github.com/bevry/projectz):
@@ -172,5 +172,3 @@ These amazing people have contributed code to this project:
[Become a contributor!](https://github.com/RobLoach/jquery-once/blob/master/CONTRIBUTING.md#files)
<!-- /BACKERS -->
-
-
diff --git a/jquery.once.js b/jquery.once.js
index 4664218..1f770c1 100644
--- a/jquery.once.js
+++ b/jquery.once.js
@@ -1,10 +1,8 @@
/*!
- * jQuery Once 2.0.0-alpha.9
- * http://github.com/robloach/jquery-once
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
+ * jQuery Once v2.0.0-alpha.9 - http://github.com/robloach/jquery-once
+ * @license MIT, GPL-2.0
+ * http://opensource.org/licenses/MIT
+ * http://opensource.org/licenses/GPL-2.0
*/
/**
diff --git a/jquery.once.min.js b/jquery.once.min.js
index 45302c6..4024502 100644
--- a/jquery.once.min.js
+++ b/jquery.once.min.js
@@ -1,4 +1,8 @@
-/*! jQuery Once - v2.0.0-alpha.9 - 10/16/2014 - https://github.com/RobLoach/jquery-once
- * (c) 2014 Rob Loach (http://github.com/RobLoach)
- * Licensed GPL-2.0, MIT */
-!function(a){"use strict";"object"==typeof exports?a(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";a.fn.once=function(b){if(!b)throw new Error("An ID is required when calling jQuery.once()");var c="jquery-once-"+b;return this.filter(function(){return a(this).data(c)!==!0}).data(c,!0)},a.fn.removeOnce=function(a){return this.findOnce(a).removeData("jquery-once-"+a)},a.fn.findOnce=function(b){var c="jquery-once-"+b;return this.filter(function(){return a(this).data(c)===!0})}}); \ No newline at end of file
+/*!
+ * jQuery Once v2.0.0-alpha.9 - http://github.com/robloach/jquery-once
+ * @license MIT, GPL-2.0
+ * http://opensource.org/licenses/MIT
+ * http://opensource.org/licenses/GPL-2.0
+ */
+(function(e){"use strict";if(typeof exports==="object"){e(require("jquery"))}else if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){"use strict";e.fn.once=function(n){if(!n){throw new Error("An ID is required when calling jQuery.once()")}var r="jquery-once-"+n;return this.filter(function(){return e(this).data(r)!==true}).data(r,true)};e.fn.removeOnce=function(e){return this.findOnce(e).removeData("jquery-once-"+e)};e.fn.findOnce=function(n){var r="jquery-once-"+n;return this.filter(function(){return e(this).data(r)===true})}});
+//# sourceMappingURL=jquery.once.min.js.map \ No newline at end of file
diff --git a/jquery.once.min.js.map b/jquery.once.min.js.map
new file mode 100644
index 0000000..937c2d2
--- /dev/null
+++ b/jquery.once.min.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"jquery.once.min.js","sources":["jquery.once.js"],"names":["factory","exports","require","define","amd","jQuery","$","fn","once","id","Error","name","this","filter","data","removeOnce","findOnce","removeData"],"mappings":";;;;;;CAgBC,SAAUA,GACT,YACA,UAAWC,WAAY,SAAU,CAE/BD,EAAQE,QAAQ,eACX,UAAWC,UAAW,YAAcA,OAAOC,IAAK,CAErDD,QAAQ,UAAWH,OACd,CAELA,EAAQK,WAEV,SAAUC,GACV,YAuBAA,GAAEC,GAAGC,KAAO,SAAUC,GACpB,IAAKA,EAAI,CACP,KAAM,IAAIC,OAAM,gDAIlB,GAAIC,GAAO,eAAiBF,CAG5B,OAAOG,MAAKC,OAAO,WACjB,MAAOP,GAAEM,MAAME,KAAKH,KAAU,OAC7BG,KAAKH,EAAM,MA2BhBL,GAAEC,GAAGQ,WAAa,SAAUN,GAE1B,MAAOG,MAAKI,SAASP,GAAIQ,WAAW,eAAiBR,GA0BvDH,GAAEC,GAAGS,SAAW,SAAUP,GAExB,GAAIE,GAAO,eAAiBF,CAE5B,OAAOG,MAAKC,OAAO,WACjB,MAAOP,GAAEM,MAAME,KAAKH,KAAU"} \ No newline at end of file
diff --git a/package.json b/package.json
index 4597862..c01b6de 100644
--- a/package.json
+++ b/package.json
@@ -50,16 +50,16 @@
"jquery": "~2.1.1"
},
"devDependencies": {
+ "eslint": "~0.9.2",
"grunt": "~0.4.5",
"grunt-contrib-qunit": "~0.5.2",
- "grunt-contrib-uglify": "~0.6.0",
- "grunt-eslint": "~1.1.0",
- "projectz": "~0.3.15"
+ "projectz": "~0.3.15",
+ "uglify-js": "~2.4.15"
},
"scripts": {
- "test": "grunt",
- "projectz": "node_modules/.bin/projectz compile",
- "release": "grunt release",
+ "test": "./node_modules/.bin/eslint jquery.once.js && grunt",
+ "projectz": "./node_modules/.bin/projectz compile",
+ "release": "./node_modules/.bin/uglifyjs jquery.once.js -o jquery.once.min.js --comments --source-map jquery.once.min.js.map --mangle",
"jsdoc": "jsdoc jquery.once.js README.md"
}
}