Skip to content

Commit

Permalink
improving build
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Plentz committed Dec 28, 2013
1 parent d47daaa commit b0eb7c3
Show file tree
Hide file tree
Showing 10 changed files with 520 additions and 68 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
25 changes: 25 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"noarg": true,
"node": true,
// "onevar": true,
"quotmark": "double",
"smarttabs": true,
"trailing": true,
"unused": true,
"bitwise": true,
"browser": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"globals": {
"jQuery": true,
"console": true
}
}
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- 0.10
39 changes: 27 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,51 @@ module.exports = function(grunt) {
"use strict";

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
pkg: grunt.file.readJSON("package.json"),
meta: {
banner: "/*\n" +
" * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n" +
" * <%= pkg.description %>\n" +
" * <%= pkg.homepage %>\n" +
" *\n" +
" * Made by <%= pkg.author.name %>\n" +
" * Under <%= pkg.licenses[0].type %> License (<%= pkg.licenses[0].url %>)\n" +
" */\n"
},
jshint: {
all: ["jquery.maskMoney.js", "Gruntfile.js"],
all: ["src/jquery.maskMoney.js", "Gruntfile.js"],
options: {
globals: {
bitwise: true,
jQuery: true,
console: true,
module: true
}
jshintrc: true
}
},
concat: {
dist: {
src: ["src/jquery.maskMoney.js"],
dest: "dist/jquery.maskMoney.js"
},
options: {
banner: "<%= meta.banner %>"
}
},
uglify: {
options: {
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',
preserveComments: false,
banner: "<%= meta.banner %>",
mangle: {
except: ["jQuery", "$"]
}
},
build: {
files: [
{ src: "jquery.maskMoney.js", dest: "jquery.maskMoney.min.js" },
{ src: "src/jquery.maskMoney.js", dest: "dist/jquery.maskMoney.min.js" },
]
}
}
});

grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");

grunt.registerTask("default", ["jshint", "uglify"]);
grunt.registerTask("default", ["jshint", "concat", "uglify"]);
grunt.registerTask("travis", ["jshint"]);
};
2 changes: 1 addition & 1 deletion index.html → demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script src="jquery.maskMoney.js" type="text/javascript"></script>
<script src="../src/jquery.maskMoney.js" type="text/javascript"></script>

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

0 comments on commit b0eb7c3

Please sign in to comment.