Skip to content

Commit

Permalink
added whole page reload when jspm config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
capaj committed Jan 18, 2016
1 parent bad5f7a commit 628d1d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion hot-reloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class HotReloader extends Emitter {
this.socket.on('connect', () => {
console.log('hot reload connected to watcher on ', backendUrl)
this.socket.emit('identification', navigator.userAgent)
this.socket.emit('package.json', null, function (pjson) {
// self.pjson = pjson // maybe needed in the future?
self.jspmConfigFile = pjson.jspm.configFile || 'config.js'
})
})
this.socket.on('reload', () => {
console.log('whole page reload requested')
Expand All @@ -50,7 +54,7 @@ class HotReloader extends Emitter {
onFileChanged (ev) {
let moduleName = ev.path
this.emit('change', moduleName)
if (moduleName === 'index.html') {
if (moduleName === 'index.html' || moduleName === this.jspmConfigFile) {
document.location.reload(true)
} else {
if (this.lastFailedSystemImport) { // for wehn inital System.import fails
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "systemjs-hot-reloader",
"version": "0.5.2",
"version": "0.5.3",
"description": "JSPM utility for hot reloading modules of your app separately",
"main": "hot-reloader.js",
"scripts": {
Expand All @@ -19,17 +19,17 @@
},
"homepage": "https://github.com/capaj/systemjs-hot-reloader#readme",
"dependencies": {
"socket.io-client": "^1.3.7",
"socket.io-client": "^1.4.4",
"weakee": "^0.9.1"
},
"devDependencies": {
"babel": "^5.8.23",
"chai": "^3.3.0",
"chokidar-socket-emitter": "^0.3.0",
"chokidar-socket-emitter": "^0.4.2",
"debug": "^2.2.0",
"husky": "^0.10.1",
"mocha": "^2.3.3",
"standard": "^5.3.1",
"standard": "^5.4.1",
"systemjs": "^0.19.6"
},
"jspm": {
Expand Down

0 comments on commit 628d1d1

Please sign in to comment.