diff --git a/src/main/utils/Constants.ts b/src/main/utils/Constants.ts index cc36a55..c4ede10 100644 --- a/src/main/utils/Constants.ts +++ b/src/main/utils/Constants.ts @@ -10,7 +10,8 @@ export default class Constants { static DEFAULT_WEB_PREFERENCES = { nodeIntegration: true, contextIsolation: false, - nodeIntegrationInWorker: true + nodeIntegrationInWorker: true, + preload: join(__dirname, '../preload/index.js') } static APP_INDEX_URL_DEV = 'http://localhost:5173/index.html' diff --git a/src/preload/index.ts b/src/preload/index.ts new file mode 100644 index 0000000..26df21e --- /dev/null +++ b/src/preload/index.ts @@ -0,0 +1,5 @@ +const main = (): void => { + console.log('[Preload] Script loaded.') +} + +main() diff --git a/vite.config.js b/vite.config.js index 0ddc861..a8dc1f4 100644 --- a/vite.config.js +++ b/vite.config.js @@ -40,7 +40,7 @@ export default defineConfig({ // Docs: https://github.com/electron-vite/vite-plugin-electron electronPlugin([ { - entry: ['src/preload/index.js'], + entry: ['src/preload/index.ts'], vite: { build: { outDir: 'dist/preload'