pack: add preload example
This commit is contained in:
1 parent
4836fbeb7d
commit
f6b899ab73
3 files changed
+8
-2
No files matched your search
@@ -10,7 +10,8 @@ export default class Constants {
|
|||||||
static DEFAULT_WEB_PREFERENCES = {
|
static DEFAULT_WEB_PREFERENCES = {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
nodeIntegrationInWorker: true
|
nodeIntegrationInWorker: true,
|
||||||
|
preload: join(__dirname, '../preload/index.js')
|
||||||
}
|
}
|
||||||
|
|
||||||
static APP_INDEX_URL_DEV = 'http://localhost:5173/index.html'
|
static APP_INDEX_URL_DEV = 'http://localhost:5173/index.html'
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
const main = (): void => {
|
||||||
|
console.log('[Preload] Script loaded.')
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
+1
-1
@@ -40,7 +40,7 @@ export default defineConfig({
|
|||||||
// Docs: https://github.com/electron-vite/vite-plugin-electron
|
// Docs: https://github.com/electron-vite/vite-plugin-electron
|
||||||
electronPlugin([
|
electronPlugin([
|
||||||
{
|
{
|
||||||
entry: ['src/preload/index.js'],
|
entry: ['src/preload/index.ts'],
|
||||||
vite: {
|
vite: {
|
||||||
build: {
|
build: {
|
||||||
outDir: 'dist/preload'
|
outDir: 'dist/preload'
|
||||||
|
|||||||
Reference in new issue
Block a user