diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-07-18 15:07:37 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-08-15 17:39:38 +0200 |
| commit | 71592249b2dd669b6f24f37bfb7b0f4e43b74998 (patch) | |
| tree | a6097dc7e5d94d06e99c65fdfe160e824395f50c /scripts | |
| parent | e84e87f4ce5a8c242f756566cdc6fb59a45f7bea (diff) | |
| download | mullvadvpn-71592249b2dd669b6f24f37bfb7b0f4e43b74998.tar.xz mullvadvpn-71592249b2dd669b6f24f37bfb7b0f4e43b74998.zip | |
Add workspaces
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/serve.js | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/scripts/serve.js b/scripts/serve.js deleted file mode 100644 index 03abeab2c2..0000000000 --- a/scripts/serve.js +++ /dev/null @@ -1,53 +0,0 @@ -import electron from 'electron'; -import { spawn } from 'child_process'; -import browserSync from 'browser-sync'; -import browserSyncConnectUtils from 'browser-sync/dist/connect-utils'; - -const bsync = browserSync.create(); - -const getRootUrl = (options) => { - const port = options.get('port'); - return `http://localhost:${port}`; -}; - -const getClientUrl = (options) => { - const pathname = browserSyncConnectUtils.clientScript(options); - return getRootUrl(options) + pathname; -}; - -bsync.init( - { - ui: false, - // Port 35829 = LiveReload's default port 35729 + 100. - // If the port is occupied, Browsersync uses next free port automatically. - port: 35829, - ghostMode: false, - open: false, - notify: false, - logSnippet: false, - socket: { - // Use the actual port here. - domain: getRootUrl, - }, - }, - (err, bs) => { - if (err) return console.error(err); - - const child = spawn(electron, ['.'], { - env: { - ...{ - NODE_ENV: 'development', - BROWSER_SYNC_CLIENT_URL: getClientUrl(bs.options), - }, - ...process.env, - }, - stdio: 'inherit', - }); - - child.on('close', () => { - process.exit(); - }); - - bsync.watch('build/**/*').on('change', bsync.reload); - }, -); |
