Skip to content

Commit

Permalink
grunt support
Browse files Browse the repository at this point in the history
  • Loading branch information
chen0040 committed May 16, 2017
1 parent b0c5255 commit a67579d
Show file tree
Hide file tree
Showing 11 changed files with 317 additions and 291 deletions.
24 changes: 4 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@

node_modules/

# Log file
.DS_Store
thumbs.db
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
node_modules/
.idea
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ language: node_js
node_js:
- "stable"

before_script:
- npm install -g grunt-cli

after_success:
- npm run coveralls
31 changes: 31 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = function (grunt) {
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-eslint');

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
preserveComments: 'some',
},
build: {
src: 'src/jsstats.js',
dest: 'build/jsstats.min.js',
},
},
mochaTest: {
test: {
options: {
reporter: 'spec',
},
src: ['tests/**/*.js'],
},
},
});

// Default task(s).
grunt.registerTask('default', ['uglify']);
grunt.registerTask('test', ['mochaTest']);
};
1 change: 1 addition & 0 deletions build/jsstats.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 index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./src/jsstats');
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"devDependencies": {
"chai": "^3.5.0",
"coveralls": "^2.13.1",
"grunt": "^1.0.1",
"grunt-contrib-uglify": "^3.0.0",
"grunt-eslint": "^19.0.0",
"grunt-mocha-test": "^0.13.2",
"istanbul": "^0.4.5",
"mocha": "^3.4.1"
},
Expand Down
Loading

0 comments on commit a67579d

Please sign in to comment.