grunt-surge
Version:
Publish web apps and static sites to the Surge CDN, through Grunt.
79 lines (65 loc) • 1.69 kB
JavaScript
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js',
'<%= nodeunit.tests %>',
],
options: {
jshintrc: '.jshintrc',
},
},
// Before generating any new files, remove any previously-created files.
clean: {
tests: ['tmp', './test/fixtures/www'],
},
mkdir: {
all: {
options: {
create: ['./test/fixtures/www']
},
},
},
jade: {
compile: {
options: {
data: {
debug: false
}
},
files: {
"./test/fixtures/www/index.html": ["test/fixtures/*.jade"]
}
}
},
// Configuration to be run (and then tested).
surge: {
'grunt-test-1': {
options: {
project: './test/fixtures/www',
domain: 'grunt-test-1.surge.sh'
}
}
},
// Unit tests.
nodeunit: {
tests: ['test/*_test.js'],
}
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-mkdir');
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
grunt.registerTask('test', ['clean', 'mkdir', 'jade', 'surge', 'nodeunit']);
// By default, lint and run all tests.
grunt.registerTask('default', ['jshint', 'test']);
};