diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-07-12 10:09:43 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-07-12 10:09:43 +0200 |
| commit | 51c3233e7f2f7dbf11f11345b378ff58190b72fc (patch) | |
| tree | d98f0670439d2e208028e532041635c0d862196a /gui/tasks | |
| parent | 2f303f7158be3256f94ad437b72ab8628cfceaee (diff) | |
| parent | ffe0c6e418001f532469ce307edea7b82a663cdd (diff) | |
| download | mullvadvpn-51c3233e7f2f7dbf11f11345b378ff58190b72fc.tar.xz mullvadvpn-51c3233e7f2f7dbf11f11345b378ff58190b72fc.zip | |
Merge branch 'update-to-electron-11.4.9'
Diffstat (limited to 'gui/tasks')
| -rw-r--r-- | gui/tasks/dev-server.js | 40 | ||||
| -rw-r--r-- | gui/tasks/scripts.js | 1 | ||||
| -rw-r--r-- | gui/tasks/watch.js | 2 |
3 files changed, 1 insertions, 42 deletions
diff --git a/gui/tasks/dev-server.js b/gui/tasks/dev-server.js deleted file mode 100644 index 067174ab17..0000000000 --- a/gui/tasks/dev-server.js +++ /dev/null @@ -1,40 +0,0 @@ -const serverFactory = require('spa-server'); - -function startWebServer(done) { - serverFactory - .create({ - path: './build', - port: 8080, - middleware: [correctWorkingDirectory], - }) - .start(done); -} - -function correctWorkingDirectory(request, response, next) { - if (request.url === '/src/renderer/index.js') { - const write = response.write.bind(response); - response.write = (data) => { - let s = data.toString(); - - // Add code that changes to the correct working directory after `"use strict";` which is - // located on the first line of the source file. - const index = s.indexOf('\n'); - - if (index !== -1) { - const insertionIndex = index + 1; - s = - s.slice(0, insertionIndex) + - 'try{process.chdir("build/src/renderer")}catch(e){}\n' + - s.slice(insertionIndex); - } - - write(s); - }; - } - - next(); -} - -startWebServer.displayName = 'start-dev-server'; - -exports.start = startWebServer; diff --git a/gui/tasks/scripts.js b/gui/tasks/scripts.js index eda057d983..ec38c7c3fa 100644 --- a/gui/tasks/scripts.js +++ b/gui/tasks/scripts.js @@ -82,6 +82,7 @@ function makeBrowserifyPreload(debug) { let stream = browserify({ entries: './build/src/renderer/preload.js', debug, + detectGlobals: false, }) .exclude('electron') .bundle() diff --git a/gui/tasks/watch.js b/gui/tasks/watch.js index 543e5f7b08..7badef949e 100644 --- a/gui/tasks/watch.js +++ b/gui/tasks/watch.js @@ -1,6 +1,5 @@ const { parallel, series, watch } = require('gulp'); const electron = require('./electron'); -const devServer = require('./dev-server'); const assets = require('./assets'); const scripts = require('./scripts'); @@ -39,7 +38,6 @@ exports.start = series( // set up hotreload, run electron and begin watching filesystem for changes, after the first // successful build series( - devServer.start, electron.start, parallel(watchMainScripts, watchCss, watchConfig, watchHtml, watchStaticAssets), ), |
