Skip to content

Commit 368ad7f

Browse files
committed
fix(build): update to grunt-contrib-connect 0.4.0
1 parent 0568e74 commit 368ad7f

File tree

2 files changed

+13
-25
lines changed

2 files changed

+13
-25
lines changed

templates/common/Gruntfile.js

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
22
'use strict';
33
var LIVERELOAD_PORT = 35729;
4-
var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT });
5-
var mountFolder = function (connect, dir) {
6-
return connect.static(require('path').resolve(dir));
7-
};
84

95
// # Globbing
106
// for performance reasons we're only matching one level down:
@@ -76,38 +72,31 @@ module.exports = function (grunt) {
7672
},
7773
livereload: {
7874
options: {
79-
middleware: function (connect) {
80-
return [
81-
lrSnippet,
82-
mountFolder(connect, '.tmp'),
83-
mountFolder(connect, yeomanConfig.app)
84-
];
85-
}
75+
livereload: LIVERELOAD_PORT,
76+
base: [
77+
'.tmp',
78+
yeomanConfig.app
79+
]
8680
}
8781
},
8882
test: {
8983
options: {
90-
middleware: function (connect) {
91-
return [
92-
mountFolder(connect, '.tmp'),
93-
mountFolder(connect, 'test')
94-
];
95-
}
84+
middleware: [
85+
'.tmp',
86+
'test',
87+
yeomanConfig.app
88+
]
9689
}
9790
},
9891
dist: {
9992
options: {
100-
middleware: function (connect) {
101-
return [
102-
mountFolder(connect, yeomanConfig.dist)
103-
];
104-
}
93+
base: yeomanConfig.dist
10594
}
10695
}
10796
},
10897
open: {
10998
server: {
110-
url: 'http://localhost:<%%= connect.options.port %>'
99+
url: 'http://localhost:<%%= connect.options.port %>/index.html'
111100
}
112101
},
113102
clean: {

templates/common/_package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"grunt-contrib-compass": "~0.5.0",
1212
"grunt-contrib-jshint": "~0.6.0",
1313
"grunt-contrib-cssmin": "~0.6.0",
14-
"grunt-contrib-connect": "~0.3.0",
14+
"grunt-contrib-connect": "~0.4.0",
1515
"grunt-contrib-clean": "~0.5.0",
1616
"grunt-contrib-htmlmin": "~0.1.3",
1717
"grunt-contrib-imagemin": "~0.2.0",
@@ -23,7 +23,6 @@
2323
"grunt-open": "~0.2.0",
2424
"grunt-concurrent": "~0.3.0",
2525
"load-grunt-tasks": "~0.1.0",
26-
"connect-livereload": "~0.2.0",
2726
"grunt-google-cdn": "~0.2.0",
2827
"grunt-ngmin": "~0.0.2",
2928
"time-grunt": "~0.1.0"

0 commit comments

Comments
 (0)