Skip to content

Commit

Permalink
Merge pull request #235 from mischah/feature/minified-version
Browse files Browse the repository at this point in the history
Add minified version via Grunt/UglifyJS
  • Loading branch information
Erik Montes committed Dec 29, 2014
2 parents 4356d42 + bad318c commit 6b7e204
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 1 deletion.
46 changes: 46 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use strict';

module.exports = function(grunt) {

// Get devDependencies
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});

// Displays the execution time of grunt tasks
require('time-grunt')(grunt);

// Config
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

// uglify
uglify: {
options: {
sourceMap: true,
compress: {
drop_console: true,
drop_debugger: true
},
banner: '/* <%= pkg.title %> - v<%= pkg.version %>\n' +
' * Copyright ©<%= grunt.template.today("yyyy") %> Mathias Bynens\n' +
' * <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' */'
},
minify : {
files: {
'jquery.placeholder.min.js': ['jquery.placeholder.js']
}
}
}

});

/**
* Register own tasks by putting together existing ones
*/

// Default task
grunt.registerTask('default',
['uglify']
);

};
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ You can install jquery-placeholder by using [Bower](http://bower.io).
bower install jquery-placeholder
```

Contributors should install the »dev dependencies« after forking and cloning via [npm](https://www.npmjs.com/).

```bash
npm install
```

## Notes

* 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).
Expand Down
4 changes: 3 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"ignore": [
"*",
"!/bower.json",
"!/jquery.placeholder.js"
"!/jquery.placeholder.js",
"!/jquery.placeholder.min.js",
"!/jquery.placeholder.min.js.map"
]
}
6 changes: 6 additions & 0 deletions jquery.placeholder.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions jquery.placeholder.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "jquery-placeholder",
"version": "2.0.9",
"title": "HTML5 Placeholder jQuery Plugin",
"description": "A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet",
"author": {
"name": "Mathias Bynens",
"url": "https://mathiasbynens.be/"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/mathiasbynens/jquery-placeholder.git"
},
"homepage": "https://github.com/mathiasbynens/jquery-placeholder",
"bugs": {
"url": "https://github.com/mathiasbynens/jquery-placeholder/issues"
},
"main": "jquery.placeholder.js",
"directories": {
"test": "tests"
},
"private": true,
"scripts": {
"postinstall": "bower install"
},
"keywords": [
"form",
"placeholder",
"jQuery",
"jquery-plugin"
],
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-uglify": "^0.7.0",
"grunt-notify": "^0.4.1",
"load-grunt-tasks": "^2.0.0",
"time-grunt": "^1.0.0"
}
}

0 comments on commit 6b7e204

Please sign in to comment.