mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-25 09:23:17 +01:00
feat: electron sandbox bundle libraries check (#2932)
chore: check sandbox libraries bundle file
This commit is contained in:
parent
ad388e5a6a
commit
b4fd350334
@ -1,5 +1,15 @@
|
|||||||
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const isDev = require('electron-is-dev');
|
const isDev = require('electron-is-dev');
|
||||||
|
|
||||||
|
if (isDev) {
|
||||||
|
if (!fs.existsSync('./src/sandbox/bundle-browser-rollup.js')) {
|
||||||
|
console.log('JS Sandbox libraries have not been bundled yet');
|
||||||
|
console.log('Please run the below command \nnpm run sandbox:bundle-libraries --workspace=packages/bruno-js');
|
||||||
|
throw new Error('JS Sandbox libraries have not been bundled yet');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const { format } = require('url');
|
const { format } = require('url');
|
||||||
const { BrowserWindow, app, Menu, ipcMain } = require('electron');
|
const { BrowserWindow, app, Menu, ipcMain } = require('electron');
|
||||||
const { setContentSecurityPolicy } = require('electron-util');
|
const { setContentSecurityPolicy } = require('electron-util');
|
||||||
@ -70,7 +80,7 @@ app.on('ready', async () => {
|
|||||||
|
|
||||||
mainWindow.once('ready-to-show', () => {
|
mainWindow.once('ready-to-show', () => {
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
})
|
});
|
||||||
const url = isDev
|
const url = isDev
|
||||||
? 'http://localhost:3000'
|
? 'http://localhost:3000'
|
||||||
: format({
|
: format({
|
||||||
|
Loading…
Reference in New Issue
Block a user