Skip to content

Commit b0eb7c3

Browse files
author
Diego Plentz
committed
improving build
1 parent d47daaa commit b0eb7c3

File tree

10 files changed

+520
-68
lines changed

10 files changed

+520
-68
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
indent_style = tab
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true

.jshintrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"boss": true,
3+
"curly": true,
4+
"eqeqeq": true,
5+
"eqnull": true,
6+
"expr": true,
7+
"immed": true,
8+
"noarg": true,
9+
"node": true,
10+
// "onevar": true,
11+
"quotmark": "double",
12+
"smarttabs": true,
13+
"trailing": true,
14+
"unused": true,
15+
"bitwise": true,
16+
"browser": true,
17+
"camelcase": true,
18+
"curly": true,
19+
"eqeqeq": true,
20+
"eqnull": true,
21+
"globals": {
22+
"jQuery": true,
23+
"console": true
24+
}
25+
}

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: node_js
2+
node_js:
3+
- 0.10

Gruntfile.js

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,51 @@ module.exports = function(grunt) {
22
"use strict";
33

44
grunt.initConfig({
5-
pkg: grunt.file.readJSON('package.json'),
5+
pkg: grunt.file.readJSON("package.json"),
6+
meta: {
7+
banner: "/*\n" +
8+
" * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n" +
9+
" * <%= pkg.description %>\n" +
10+
" * <%= pkg.homepage %>\n" +
11+
" *\n" +
12+
" * Made by <%= pkg.author.name %>\n" +
13+
" * Under <%= pkg.licenses[0].type %> License (<%= pkg.licenses[0].url %>)\n" +
14+
" */\n"
15+
},
616
jshint: {
7-
all: ["jquery.maskMoney.js", "Gruntfile.js"],
17+
all: ["src/jquery.maskMoney.js", "Gruntfile.js"],
818
options: {
9-
globals: {
10-
bitwise: true,
11-
jQuery: true,
12-
console: true,
13-
module: true
14-
}
19+
jshintrc: true
1520
}
1621
},
22+
concat: {
23+
dist: {
24+
src: ["src/jquery.maskMoney.js"],
25+
dest: "dist/jquery.maskMoney.js"
26+
},
27+
options: {
28+
banner: "<%= meta.banner %>"
29+
}
30+
},
1731
uglify: {
1832
options: {
19-
banner: '/*\n <%= pkg.description %>\n version: <%= pkg.version %>\n <%= pkg.homepage %>\n Copyright (c) 2009 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n Licensed under the MIT license (https://github.com/plentz/jquery-maskmoney/blob/master/LICENSE)\n*/\n',
20-
preserveComments: false,
33+
banner: "<%= meta.banner %>",
2134
mangle: {
2235
except: ["jQuery", "$"]
2336
}
2437
},
2538
build: {
2639
files: [
27-
{ src: "jquery.maskMoney.js", dest: "jquery.maskMoney.min.js" },
40+
{ src: "src/jquery.maskMoney.js", dest: "dist/jquery.maskMoney.min.js" },
2841
]
2942
}
3043
}
3144
});
3245

46+
grunt.loadNpmTasks("grunt-contrib-concat");
3347
grunt.loadNpmTasks("grunt-contrib-jshint");
3448
grunt.loadNpmTasks("grunt-contrib-uglify");
3549

36-
grunt.registerTask("default", ["jshint", "uglify"]);
50+
grunt.registerTask("default", ["jshint", "concat", "uglify"]);
51+
grunt.registerTask("travis", ["jshint"]);
3752
};

index.html renamed to demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<head>
33
<meta charset="utf-8">
44
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
5-
<script src="jquery.maskMoney.js" type="text/javascript"></script>
5+
<script src="../src/jquery.maskMoney.js" type="text/javascript"></script>
66

77
<!-- just necessary for syntax highlight -->
88
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css' />

0 commit comments

Comments
 (0)