UNPKG

emcellent-toolkit

Version:

A toolkit for performing neat functions with M/MUMPS data.

98 lines (93 loc) 3 kB
module.exports = function (grunt) { grunt.loadNpmTasks('grunt-mocha-test'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-jsbeautifier'); grunt.loadNpmTasks('grunt-browserify'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.registerTask('default', ['jshint', 'mochaTest', 'jsbeautifier']); grunt.registerTask('build:browser', ['jshint', 'mochaTest', 'browserify', 'uglify']); grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { files: ['./lib/*.js', 'index.js', 'gruntFile.js', './test/**/*.js'], options: { browser: true, curly: true, eqeqeq: true, immed: true, latedef: true, newcap: true, noarg: true, sub: true, undef: false, boss: true, eqnull: true, node: true, expr: true, globals: { 'xit': true, 'xdescribe': true, 'it': true, 'describe': true, 'before': true, 'after': true, 'done': true } } }, jsbeautifier: { beautify: { src: ['./lib/*.js', 'index.js', 'gruntFile.js', './test/**/*.js'], options: { config: '.jsbeautifyrc' } }, check: { src: ['./lib/*.js', 'index.js', 'gruntFile.js', './test/**/*.js'], options: { mode: 'VERIFY_ONLY', config: '.jsbeautifyrc' } } }, browserify: { dist: { files: { 'dist/emcellent-toolkit.min.js': ['index.js'] } }, options: { browserifyOptions: { standalone: 'mTools' } } }, uglify: { options: { banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %> */' + '\n' }, my_target: { files: { 'dist/emcellent-toolkit.min.js': ['dist/emcellent-toolkit.min.js'] } } }, watch: { all: { files: ['./lib/*.js', 'index.js', 'gruntFile.js', './test/**/*.js'], tasks: ['default'] } }, mochaTest: { test: { options: { reporter: 'spec', timeout: '10000' }, src: ['test/unit/*.js', 'test/e2e/*.js'] } } }); };