mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 10:40:41 +01:00
server-esm: Fix a few more straightforward imports
This commit is contained in:
@@ -132,7 +132,7 @@ function getIcon() {
|
||||
}
|
||||
|
||||
async function createSetupWindow() {
|
||||
const { BrowserWindow } = require('electron'); // should not be statically imported
|
||||
const { BrowserWindow } = await import("electron"); // should not be statically imported
|
||||
setupWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 800,
|
||||
@@ -156,7 +156,7 @@ function closeSetupWindow() {
|
||||
}
|
||||
|
||||
async function registerGlobalShortcuts() {
|
||||
const { globalShortcut } = require('electron');
|
||||
const { globalShortcut } = await import("electron");
|
||||
|
||||
await sqlInit.dbReady;
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import { IncomingMessage, Server } from 'http';
|
||||
import { EntityChange } from './entity_changes_interface';
|
||||
|
||||
if (env.isDev()) {
|
||||
const chokidar = require('chokidar');
|
||||
const debounce = require('debounce');
|
||||
const chokidar = (await import("chokidar")).default;
|
||||
const debounce = (await import("debounce")).default;
|
||||
const debouncedReloadFrontend = debounce(() => reloadFrontend("source code change"), 200);
|
||||
chokidar
|
||||
.watch('src/public')
|
||||
|
||||
Reference in New Issue
Block a user