Skip to content

Commit 58be409

Browse files
committed
Add Grunt support. Minify JS with UglifyJS. Fix bug in example code
1 parent c02e0e8 commit 58be409

File tree

6 files changed

+56
-2
lines changed

6 files changed

+56
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Include your project-specific ignores in this file
22
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
33

4+
node_modules
45
*.sublime*
56
*.html

Gruntfile.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = function( grunt ) {
2+
3+
grunt.initConfig({
4+
pkg: grunt.file.readJSON( 'package.json' ),
5+
6+
uglify: {
7+
options: {
8+
preserveComments: 'some'
9+
},
10+
build: {
11+
src: 'src/inherit.js',
12+
dest: 'dist/inherit.min.js'
13+
},
14+
}
15+
16+
});
17+
18+
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
19+
grunt.registerTask( 'default', ['uglify'] );
20+
21+
};

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inherit( childConstructor, parentConstructor )
1313

1414
```javascript
1515
function Grandfather() {}
16-
Gradfather.prototype.getName = function () { return 'John Doe I'; };
16+
Grandfather.prototype.getName = function () { return 'John Doe I'; };
1717
function Father() {}
1818
Father.prototype.getName = function () { return 'John Doe II'; };
1919

dist/inherit.min.js

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

package.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "inherit.js",
3+
"version": "0.1.0",
4+
"description": "An easy way to properly use prototype chaining.",
5+
"homepage": "http://github.com/getsnoopy/inherit.js",
6+
"license": {
7+
"type": "MIT",
8+
"url": "http://github.com/getsnoopy/inherit.js/blob/master/LICENSE.md"
9+
},
10+
"author": {
11+
"name": "Varun Varada",
12+
"url": "http://www.escisx.com"
13+
},
14+
"repository": {
15+
"type": "git",
16+
"url": "git://github.com/getsnoopy/inherit.js.git"
17+
},
18+
"bugs": "https://github.com/getsnoopy/inherit.js/issues",
19+
"devDependencies": {
20+
"grunt": "~0.4.1",
21+
"grunt-contrib-uglify": "^0.6.0"
22+
}
23+
}

inherit.js src/inherit.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
22
* inherit.js
3-
* Varun Varada
3+
* @license inherit.js Copyright (c) 2014 Varun Varada. All Rights Reserved.
4+
* Available via the MIT license.
5+
* see: http://github.com/getsnoopy/inherit.js for details
46
*/
57

68
(function ( global ) {

0 commit comments

Comments
 (0)