17f21fd1 by Adam Heath

Starting to fill iout basic dynamic grunt config.

1 parent c7a40343
......@@ -11,9 +11,12 @@
"node": ">=0.8.0"
},
"dependencies": {
"grunt": "~0"
"grunt": "~0",
"grunt-contrib-csslint": "~0",
"grunt-contrib-jshint": "~0",
"grunt-contrib-htmlmin": "~0",
"lodash": "~2"
},
"devDependencies": {
"grunt": "~0"
}
}
......
......@@ -6,4 +6,61 @@
'use strict';
module.exports = function (grunt) {
var _ = require('lodash');
function createConfig(mpConfig) {
var initConfig = {};
var checkList = [];
if (mpConfig.jshint) {
grunt.loadNpmTasks('grunt-contrib-jshint');
initConfig.jshint = {
options: mpConfig.jshint.options,
all: [
'Gruntfile.js',
],
main: {
options: _.extend({}, mpConfig.jshint.browserOptions, {
globals: {
define: false,
require: false,
},
}),
files: {
src: [
'src/scripts/main.js',
],
},
}
};
checkList.push('jshint');
}
if (mpConfig.csslint) {
grunt.loadNpmTasks('grunt-contrib-csslint');
initConfig.csslint = {
};
checkList.push('csslint');
}
if (mpConfig.htmlmin) {
grunt.loadNpmTasks('grunt-contrib-htmlmin');
initConfig.htmlmin = {
};
checkList.push('htmlmin');
}
grunt.initConfig(initConfig);
grunt.registerTask('check', checkList);
grunt.registerTask('default', [
'check',
]);
}
return {
createConfig: createConfig,
};
};
......