Created
September 29, 2014 19:54
-
-
Save michaeljacobdavis/44b45f9b1e50529b8e8d to your computer and use it in GitHub Desktop.
Grunt Clean Up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(grunt) { | |
| 'use strict'; | |
| var _ = require('lodash'); | |
| // Configuration | |
| // ------------- | |
| // Load Tasks | |
| // ---------- | |
| var tasks = grunt.file.expand([ | |
| './tasks/**.js' | |
| ]); | |
| var taskConfigs = _.reduce(tasks, function (taskObj, task) { | |
| // Loads the tasks and merges configuration sub-object for inclusion in | |
| // `initConfig`. | |
| return _.merge(taskObj, require(task)(grunt)); | |
| }, {}); | |
| // Task Configuration | |
| // ------------------ | |
| grunt.initConfig(_.merge({ | |
| pkg: grunt.file.readJSON('package.json') | |
| }, taskConfigs)); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Style Enforcement | |
| // ================= | |
| module.exports = function (grunt) { | |
| // Configuration | |
| // ------------- | |
| var cfg = { | |
| eslint: { | |
| options: { | |
| config: '.eslintrc' | |
| }, | |
| target: ['repo/**/*.js', '!**/node_modules/**/*.js', '!**/vendor/**/*.js', '!repo/bundles/**/*.js'] | |
| } | |
| }; | |
| // Plugins | |
| // ------- | |
| grunt.loadNpmTasks('grunt-eslint'); | |
| // Tasks | |
| // ----- | |
| return cfg; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment