Skip to content

Commit 6b7e204

Browse files
author
Erik Montes
committed
Merge pull request #235 from mischah/feature/minified-version
Add minified version via Grunt/UglifyJS
2 parents 4356d42 + bad318c commit 6b7e204

6 files changed

+102
-1
lines changed

Gruntfile.js

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
'use strict';
2+
3+
module.exports = function(grunt) {
4+
5+
// Get devDependencies
6+
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
7+
8+
// Displays the execution time of grunt tasks
9+
require('time-grunt')(grunt);
10+
11+
// Config
12+
grunt.initConfig({
13+
pkg: grunt.file.readJSON('package.json'),
14+
15+
// uglify
16+
uglify: {
17+
options: {
18+
sourceMap: true,
19+
compress: {
20+
drop_console: true,
21+
drop_debugger: true
22+
},
23+
banner: '/* <%= pkg.title %> - v<%= pkg.version %>\n' +
24+
' * Copyright ©<%= grunt.template.today("yyyy") %> Mathias Bynens\n' +
25+
' * <%= grunt.template.today("yyyy-mm-dd") %>\n' +
26+
' */'
27+
},
28+
minify : {
29+
files: {
30+
'jquery.placeholder.min.js': ['jquery.placeholder.js']
31+
}
32+
}
33+
}
34+
35+
});
36+
37+
/**
38+
* Register own tasks by putting together existing ones
39+
*/
40+
41+
// Default task
42+
grunt.registerTask('default',
43+
['uglify']
44+
);
45+
46+
};

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ You can install jquery-placeholder by using [Bower](http://bower.io).
5252
bower install jquery-placeholder
5353
```
5454

55+
Contributors should install the »dev dependencies« after forking and cloning via [npm](https://www.npmjs.com/).
56+
57+
```bash
58+
npm install
59+
```
60+
5561
## Notes
5662

5763
* Requires jQuery 1.6+. For an older version of this plugin that works under jQuery 1.4.2+, see [v1.8.7](https://github.com/mathiasbynens/jquery-placeholder/tree/v1.8.7).

bower.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"ignore": [
1717
"*",
1818
"!/bower.json",
19-
"!/jquery.placeholder.js"
19+
"!/jquery.placeholder.js",
20+
"!/jquery.placeholder.min.js",
21+
"!/jquery.placeholder.min.js.map"
2022
]
2123
}

jquery.placeholder.min.js

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery.placeholder.min.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "jquery-placeholder",
3+
"version": "2.0.9",
4+
"title": "HTML5 Placeholder jQuery Plugin",
5+
"description": "A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet",
6+
"author": {
7+
"name": "Mathias Bynens",
8+
"url": "https://mathiasbynens.be/"
9+
},
10+
"license": "MIT",
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/mathiasbynens/jquery-placeholder.git"
14+
},
15+
"homepage": "https://github.com/mathiasbynens/jquery-placeholder",
16+
"bugs": {
17+
"url": "https://github.com/mathiasbynens/jquery-placeholder/issues"
18+
},
19+
"main": "jquery.placeholder.js",
20+
"directories": {
21+
"test": "tests"
22+
},
23+
"private": true,
24+
"scripts": {
25+
"postinstall": "bower install"
26+
},
27+
"keywords": [
28+
"form",
29+
"placeholder",
30+
"jQuery",
31+
"jquery-plugin"
32+
],
33+
"devDependencies": {
34+
"grunt": "^0.4.5",
35+
"grunt-contrib-uglify": "^0.7.0",
36+
"grunt-notify": "^0.4.1",
37+
"load-grunt-tasks": "^2.0.0",
38+
"time-grunt": "^1.0.0"
39+
}
40+
}

0 commit comments

Comments
 (0)