diff --git a/packages/electron/package.json b/packages/electron/package.json index a84e06d..e737f85 100644 --- a/packages/electron/package.json +++ b/packages/electron/package.json @@ -17,6 +17,7 @@ ], "dependencies": { "@flecks/core": "^1.4.1", + "@neutrinojs/banner": "^9.5.0", "electron": "^18.0.1", "electron-devtools-installer": "^3.2.0" }, diff --git a/packages/electron/src/server/index.js b/packages/electron/src/server/index.js index a34305f..4d063b7 100644 --- a/packages/electron/src/server/index.js +++ b/packages/electron/src/server/index.js @@ -2,6 +2,7 @@ import cluster from 'cluster'; import {join} from 'path'; import {require as R} from '@flecks/core/server'; +import banner from '@neutrinojs/banner'; import { app, BrowserWindow, @@ -21,6 +22,16 @@ async function createWindow(flecks) { } export const hooks = { + '@flecks/core.build': (target, config) => { + if ('server' === target) { + config.use.push(banner({ + banner: "require('module').Module._initPaths();", + include: 'index.js', + pluginId: 'initPaths', + raw: true, + })); + } + }, '@flecks/core.config': () => ({ /** * Browser window options.