Remove use of grunt-open in favor of the option in grunt-contrib-connect

This commit is contained in:
Guillaume Martigny 2018-02-07 16:09:56 +01:00 committed by Julian Descottes
parent bcee24609f
commit 7c215ebcbe
2 changed files with 8 additions and 21 deletions

View File

@ -47,16 +47,13 @@ module.exports = function(grunt) {
var integrationTestPaths = require('./test/casperjs/integration/IntegrationSuite.js').tests; var integrationTestPaths = require('./test/casperjs/integration/IntegrationSuite.js').tests;
var integrationTests = prefixPaths(integrationTestPaths, "test/casperjs/integration/"); var integrationTests = prefixPaths(integrationTestPaths, "test/casperjs/integration/");
var getConnectConfig = function (base, port, host) { var getConnectConfig = function (base, port, host, open) {
if (typeof base === 'string') {
base = [base];
}
return { return {
options: { options: {
port: port, port: port,
hostname : host, hostname : host,
base: base base: base,
open: open
} }
}; };
}; };
@ -98,18 +95,9 @@ module.exports = function(grunt) {
*/ */
connect: { connect: {
prod: getConnectConfig('dest/prod', PORT.PROD, hostname), prod: getConnectConfig('dest/prod', PORT.PROD, hostname, true),
test: getConnectConfig(['dest/dev', 'test'], PORT.TEST, hostname), test: getConnectConfig(['dest/dev', 'test'], PORT.TEST, hostname, false),
dev: getConnectConfig(['dest/dev', 'test'], PORT.DEV, hostname) dev: getConnectConfig(['dest/dev', 'test'], PORT.DEV, hostname, 'http://' + hostname + ':' + PORT.DEV + '/?debug')
},
open : {
prod : {
path : 'http://' + hostname + ':' + PORT.PROD + '/'
},
dev : {
path : 'http://' + hostname + ':' + PORT.DEV + '/?debug'
}
}, },
watch: { watch: {
@ -343,9 +331,9 @@ module.exports = function(grunt) {
// SERVER TASKS // SERVER TASKS
// Start webserver and watch for changes // Start webserver and watch for changes
grunt.registerTask('serve', ['build', 'connect:prod', 'open:prod', 'watch:prod']); grunt.registerTask('serve', ['build', 'connect:prod', 'watch:prod']);
// Start webserver on src folder, in debug mode // Start webserver on src folder, in debug mode
grunt.registerTask('play', ['build-dev', 'connect:dev', 'open:dev', 'watch:dev']); grunt.registerTask('play', ['build-dev', 'connect:dev', 'watch:dev']);
// ALIASES, kept for backward compatibility // ALIASES, kept for backward compatibility
grunt.registerTask('serve-debug', ['play']); grunt.registerTask('serve-debug', ['play']);

View File

@ -45,7 +45,6 @@
"grunt-karma": "1.0.0", "grunt-karma": "1.0.0",
"grunt-leading-indent": "0.2.0", "grunt-leading-indent": "0.2.0",
"grunt-nw-builder": "3.1.0", "grunt-nw-builder": "3.1.0",
"grunt-open": "0.2.3",
"grunt-replace": "1.0.1", "grunt-replace": "1.0.1",
"grunt-spritesmith": "6.4.0", "grunt-spritesmith": "6.4.0",
"jasmine-core": "2.6.1", "jasmine-core": "2.6.1",