Skip to content

Commit cdbe172

Browse files
committed
Merge pull request #103 from 10gen/INT-534_fix_livereload
INT-534: Fix livereload
2 parents 9c79cb7 + 1a9f86e commit cdbe172

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

gulpfile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ gulp.task('less', function() {
125125
// Compile jade templates to HTML files.
126126
gulp.task('pages', function() {
127127
return gulp.src('src/index.jade')
128-
.pipe(jade())
128+
.pipe(jade({
129+
locals: {
130+
NODE_ENV: process.env.NODE_ENV
131+
}
132+
}))
129133
.on('error', notify('jade'))
130134
.pipe(gulp.dest('build/'));
131135
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Injected into the dom before the app for setting up
2+
// global state if `NODE_ENV === 'development'`.
3+
4+
// Enable debugging so messages show up in the devtools console.
5+
localStorage.setItem('debug', 'mon*,sco*');

src/electron/livereload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var debounce = require('lodash').debounce;
55
var debug = require('debug')('scout:electron:livereload');
66

77
var NODE_MODULES_REGEX = /node_modules/;
8-
var WATCH_DIRECTORY = path.join(__dirname, '..');
8+
var WATCH_DIRECTORY = path.join(__dirname, '..', '..');
99

1010
var opts = {
1111
port: 35729,

src/index.jade

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ html(lang='en')
1515
//- Include the livereload client so pages reload automatically when changed.
1616
script(src='http://localhost:35729/livereload.js', charset='UTF-8')
1717

18-
//- Enable debugging so messages show up in the devtools console.
19-
script(type='text/javascript').
20-
localStorage.setItem('debug', 'mon*,sco*');
18+
script(src='src/electron/development-debug-header.js', charset='UTF-8')
2119

2220
script(src='index.js', charset='UTF-8')

0 commit comments

Comments
 (0)