1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-29 20:32:15 -05:00
mail/Gruntfile.js

82 lines
2.9 KiB
JavaScript
Raw Normal View History

2013-05-21 09:38:18 -04:00
module.exports = function(grunt) {
2013-08-09 11:23:38 -04:00
'use strict';
2013-05-21 09:38:18 -04:00
2013-08-09 11:23:38 -04:00
// Project configuration.
grunt.initConfig({
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
return [function(req, res, next) {
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'");
2013-05-22 04:16:26 -04:00
2013-08-09 11:23:38 -04:00
return next();
},
2013-05-22 04:16:26 -04:00
2013-08-09 11:23:38 -04:00
// Serve static files.
connect.static(options.base)];
}
}
}
},
2013-05-22 04:16:26 -04:00
2013-08-09 11:23:38 -04:00
jshint: {
all: ['Gruntfile.js', 'src/*.js', 'src/js/**/*.js', 'test/new-unit/*.js', 'test/unit/*.js', 'test/integration/*.js'],
2013-08-09 11:23:38 -04:00
options: {
jshintrc: '.jshintrc'
}
},
2013-05-22 04:16:26 -04:00
2013-08-09 11:23:38 -04:00
qunit: {
all: {
options: {
timeout: 20000,
urls: ['http://localhost:<%= connect.test.options.port %>/test/unit/index.html'
/*,
'http://localhost:<%= connect.test.options.port %>/test/integration/index.html'*/
]
}
}
},
mocha: {
all: {
options: {
urls: ['http://localhost:<%= connect.test.options.port %>/test/new-unit/index.html'],
run: false
}
}
2013-08-09 11:23:38 -04:00
}
});
2013-05-21 09:38:18 -04:00
2013-08-09 11:23:38 -04:00
// Load the plugin(s)
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-mocha');
2013-05-21 09:38:18 -04:00
2013-08-09 11:23:38 -04:00
// Default task(s).
grunt.registerTask('dev', ['connect:dev']);
grunt.registerTask('test', ['jshint', 'connect:test', 'mocha', 'qunit']);
2013-08-09 11:23:38 -04:00
grunt.registerTask('prod', ['connect:prod']);
2013-05-21 09:38:18 -04:00
};