Skip to content

Commit 628d1d1

Browse files
committed
added whole page reload when jspm config changes
1 parent bad5f7a commit 628d1d1

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

hot-reloader.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ class HotReloader extends Emitter {
3333
this.socket.on('connect', () => {
3434
console.log('hot reload connected to watcher on ', backendUrl)
3535
this.socket.emit('identification', navigator.userAgent)
36+
this.socket.emit('package.json', null, function (pjson) {
37+
// self.pjson = pjson // maybe needed in the future?
38+
self.jspmConfigFile = pjson.jspm.configFile || 'config.js'
39+
})
3640
})
3741
this.socket.on('reload', () => {
3842
console.log('whole page reload requested')
@@ -50,7 +54,7 @@ class HotReloader extends Emitter {
5054
onFileChanged (ev) {
5155
let moduleName = ev.path
5256
this.emit('change', moduleName)
53-
if (moduleName === 'index.html') {
57+
if (moduleName === 'index.html' || moduleName === this.jspmConfigFile) {
5458
document.location.reload(true)
5559
} else {
5660
if (this.lastFailedSystemImport) { // for wehn inital System.import fails

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "systemjs-hot-reloader",
3-
"version": "0.5.2",
3+
"version": "0.5.3",
44
"description": "JSPM utility for hot reloading modules of your app separately",
55
"main": "hot-reloader.js",
66
"scripts": {
@@ -19,17 +19,17 @@
1919
},
2020
"homepage": "https://github.com/capaj/systemjs-hot-reloader#readme",
2121
"dependencies": {
22-
"socket.io-client": "^1.3.7",
22+
"socket.io-client": "^1.4.4",
2323
"weakee": "^0.9.1"
2424
},
2525
"devDependencies": {
2626
"babel": "^5.8.23",
2727
"chai": "^3.3.0",
28-
"chokidar-socket-emitter": "^0.3.0",
28+
"chokidar-socket-emitter": "^0.4.2",
2929
"debug": "^2.2.0",
3030
"husky": "^0.10.1",
3131
"mocha": "^2.3.3",
32-
"standard": "^5.3.1",
32+
"standard": "^5.4.1",
3333
"systemjs": "^0.19.6"
3434
},
3535
"jspm": {

0 commit comments

Comments
 (0)