Skip to content

Commit

Permalink
Added Grunt build.
Browse files Browse the repository at this point in the history
Added minified version.
  • Loading branch information
viskin committed Feb 14, 2015
1 parent 05eaa03 commit ecff091
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
18 changes: 18 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = function(grunt) {

grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.initConfig({
uglify: {
target1: {
options: {
sourceMap: true
},
src: 'webSqlTracer.js',
dest: 'dist/webSqlTracer.min.js'
}
}
});

grunt.registerTask('default', ['uglify']);
};
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ To install with npm, you can
npm install websqltracer
```

Or you can download **webSqlTracer.js** from Github [master](https://raw.githubusercontent.com/terikon/webSqlTracer/master/webSqlTracer.js), and include it in your page.
Or you can download **webSqlTracer.js**
[minified](https://raw.githubusercontent.com/terikon/webSqlTracer/master/dist/webSqlTracer.min.js) or
[source](https://raw.githubusercontent.com/terikon/webSqlTracer/master/webSqlTracer.js)
from Github, and include it in your page.

webSqlTracer depends on [jquery](http://jquery.com/download) and [underscore](http://underscorejs.org/) libraries, so include them as well.

```html
<script src="jquery.min.js"></script>
<script src="underscore-min.js"></script>
<script src="webSqlTracer.js"></script>
<script src="webSqlTracer.min.js"></script>
```

This will create global **webSqlTracer** object to start your tracer.
Expand Down Expand Up @@ -188,6 +191,10 @@ Use [GitHub issues](https://github.com/terikon/webSqlTracer/issues) and [Pull Re
Ideas are wellcome as well :)
To build:
npm run build
Before comitting, please run jshint:
npm run jshint
2 changes: 2 additions & 0 deletions dist/webSqlTracer.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 dist/webSqlTracer.min.js.map

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "Console tracer for Web SQL or SQLite",
"main": "webSqlTracer.js",
"scripts": {
"build": "grunt",
"test": "echo \"Error: no test specified\" && exit 1",
"jshint": "jshint webSqlTracer.js"
},
Expand Down Expand Up @@ -35,6 +36,8 @@
"underscore": "*"
},
"devDependencies": {
"jshint": "^2.6.0"
"jshint": "^2.6.0",
"grunt": "^0.4.5",
"grunt-contrib-uglify": "^0.7.0"
}
}

0 comments on commit ecff091

Please sign in to comment.