Skip to content

Instantly share code, notes, and snippets.

@evanshortiss
Created September 8, 2014 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evanshortiss/bba8337aac5b287ad647 to your computer and use it in GitHub Desktop.
Save evanshortiss/bba8337aac5b287ad647 to your computer and use it in GitHub Desktop.
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
lintspaces: {
all: {
src: ['./src/**/*.js'],
options: {
newline: true,
trailingspaces: true,
indentation: 'spaces',
spaces: 2
}
}
},
jshint: {
with_overrides: {
jshintrc: true,
files: {
src: ['./src/**/*.js']
}
}
},
mocha: {
test: {
options: {
reporter: 'spec'
},
src: ['tests/*.js'],
},
},
browserify: {
dist: {
options: {
browserifyOptions: {
'e': './lib/LoggerFactory.js',
'o': './dist/fhlog.js',
's': 'fhlog'
}
}
}
}
});
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-lintspaces');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('format', ['lintspaces:all', 'jhint:with_overrides']);
grunt.registerTask('build', ['format', 'browserify:dist']);
grunt.registerTask('test', ['build', 'mocha:test']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment