From 4836fbeb7dd982f6bb0ff8a716f3be4f8edd7e6e Mon Sep 17 00:00:00 2001 From: leejooy96 Date: Wed, 9 Nov 2022 09:58:42 +0900 Subject: [PATCH] pack: do not include ts file after build --- electron-builder.json5 | 3 +-- vite.config.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/electron-builder.json5 b/electron-builder.json5 index ecb1a8e..50848f9 100644 --- a/electron-builder.json5 +++ b/electron-builder.json5 @@ -17,8 +17,7 @@ */ 'dist/**/*', '!docs/**/*', - '!dist/release/**/*', - '!dist/main/index.ts' + '!dist/release/**/*' ], mac: { bundleVersion: '1.0', diff --git a/vite.config.js b/vite.config.js index 9053097..0ddc861 100644 --- a/vite.config.js +++ b/vite.config.js @@ -39,15 +39,21 @@ export default defineConfig({ eslintPlugin(), // Docs: https://github.com/electron-vite/vite-plugin-electron electronPlugin([ + { + entry: ['src/preload/index.js'], + vite: { + build: { + outDir: 'dist/preload' + } + } + }, { entry: ['src/main/index.ts'], onstart: (options) => { options.startup(['.', '--no-sandbox']) }, vite: { - publicDir: resolve('./src/main'), build: { - emptyOutDir: true, assetsDir: '.', outDir: 'dist/main', rollupOptions: {