mail/Gruntfile.js

71 lines
1.9 KiB
JavaScript
Raw Normal View History

2013-05-21 09:38:18 -04:00
module.exports = function(grunt) {
2013-05-22 04:16:26 -04:00
'use strict';
2013-05-21 09:38:18 -04:00
// Project configuration.
grunt.initConfig({
2013-05-22 04:16:26 -04:00
connect: {
dev: {
options: {
port: 8580,
base: '.',
keepalive: true
}
},
test: {
options: {
port: 8581,
base: '.'
}
},
prod: {
options: {
port: process.env.PORT || 8585,
base: './src/',
keepalive: true,
middleware: function(connect, options) {
// Return array of whatever middlewares you want
2013-06-11 11:12:27 -04:00
return [function(req, res, next) {
2013-05-22 04:16:26 -04:00
res.setHeader('Content-Security-Policy', "default-src 'self'; script-src 'self' 'unsafe-eval'; connect-src *; object-src 'none'; style-src 'self' 'unsafe-inline'");
res.setHeader('X-Content-Security-Policy', "default-src *; script-src 'self' 'unsafe-eval'; options eval-script; object-src 'none'; style-src 'self' 'unsafe-inline'");
res.setHeader('X-WebKit-CSP', "default-src 'self'; script-src 'self' 'unsafe-eval'; connect-src *; object-src 'none'; style-src 'self' 'unsafe-inline'");
return next();
},
// Serve static files.
connect.static(options.base)];
}
}
}
},
2013-05-21 09:38:18 -04:00
jshint: {
2013-06-11 11:12:27 -04:00
all: ['Gruntfile.js', 'src/*.js', 'src/js/**/*.js', 'test/unit/*.js', 'test/integration/*.js'],
options: {
jshintrc: '.jshintrc'
}
2013-05-21 09:38:18 -04:00
},
2013-05-22 04:16:26 -04:00
2013-05-21 09:38:18 -04:00
qunit: {
all: {
options: {
2013-06-10 18:55:53 -04:00
timeout: 20000,
2013-06-11 11:12:27 -04:00
urls: ['http://localhost:<%= connect.test.options.port %>/test/unit/index.html',
'http://localhost:<%= connect.test.options.port %>/test/integration/index.html'
]
2013-05-21 09:38:18 -04:00
}
}
}
});
// Load the plugin(s)
2013-05-22 04:16:26 -04:00
grunt.loadNpmTasks('grunt-contrib-connect');
2013-05-21 09:38:18 -04:00
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
// Default task(s).
2013-05-22 04:16:26 -04:00
grunt.registerTask('dev', ['connect:dev']);
2013-06-11 11:12:27 -04:00
grunt.registerTask('test', ['jshint', 'connect:test', 'qunit']);
2013-05-22 04:16:26 -04:00
grunt.registerTask('prod', ['connect:prod']);
2013-05-21 09:38:18 -04:00
};