mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-15 00:47:17 +00:00
Merge pull request #380 from responsively-org/bugfix/browser-sync
Bugfix/browser sync
This commit is contained in:
commit
557ee48635
3 changed files with 14 additions and 10 deletions
|
@ -1 +1,2 @@
|
|||
export const BROWSER_SYNC_VERSION = '2.26.7';
|
||||
export const BROWSER_SYNC_PORT = '12719';
|
||||
|
|
|
@ -264,6 +264,14 @@ const createWindow = async () => {
|
|||
icon: iconPath,
|
||||
});
|
||||
|
||||
await initBrowserSync();
|
||||
ipcMain.handle('request-browser-sync', (event, data) => {
|
||||
const browserSyncOptions = {
|
||||
url: getBrowserSyncEmbedScriptURL(),
|
||||
};
|
||||
return browserSyncOptions;
|
||||
});
|
||||
|
||||
mainWindow.loadURL(`file://${__dirname}/app.html`);
|
||||
|
||||
mainWindow.webContents.on('did-finish-load', () => {
|
||||
|
@ -283,8 +291,6 @@ const createWindow = async () => {
|
|||
}
|
||||
});
|
||||
|
||||
await initBrowserSync();
|
||||
|
||||
initMainShortcutManager();
|
||||
|
||||
const onResize = () => {
|
||||
|
@ -410,13 +416,6 @@ const createWindow = async () => {
|
|||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('request-browser-sync', (event, data) => {
|
||||
const browserSyncOptions = {
|
||||
url: getBrowserSyncEmbedScriptURL(),
|
||||
};
|
||||
return browserSyncOptions;
|
||||
});
|
||||
|
||||
ipcMain.on('open-devtools', (event, ...args) => {
|
||||
const {webViewId, bounds, mode} = args[0];
|
||||
if (!webViewId) {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
const browserSyncEmbed = require('browser-sync').create('embed');
|
||||
|
||||
import {BROWSER_SYNC_VERSION} from '../constants/browserSync';
|
||||
import {
|
||||
BROWSER_SYNC_VERSION,
|
||||
BROWSER_SYNC_PORT,
|
||||
} from '../constants/browserSync';
|
||||
import fs from 'fs';
|
||||
|
||||
let filesWatcher;
|
||||
|
@ -55,6 +58,7 @@ async function initInstance(): Promise<> {
|
|||
https: true,
|
||||
notify: false,
|
||||
ui: false,
|
||||
port: BROWSER_SYNC_PORT,
|
||||
},
|
||||
(err, bs) => {
|
||||
if (err) {
|
||||
|
|
Loading…
Reference in a new issue