Skip to content

Commit

Permalink
feat: some change
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgao365 committed Dec 19, 2023
1 parent 87c4937 commit 76cbebd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ function preMergeOptions(options?: PluginOptions) {
opt.entry = [entry];
}

if (isDev) {
opt.sourcemap ??= true;
} else {
opt.minify ??= true;
}

const external = opt.external || opts.external || ['electron'];
opt.external = [...new Set(['electron'].concat(external))];
});
Expand Down Expand Up @@ -138,15 +144,6 @@ export function useElectronPlugin(options?: PluginOptions): Plugin {
opts.preload.outDir ||= path.join('dist-electron', 'preload');
}

if (isDev) {
opts.main.sourcemap ??= true;
opts.preload.sourcemap ??= true;
// opts.inspect = opts.inspect ?? true;
} else {
opts.main.minify ??= true;
opts.preload.minify ??= true;
}

return {
build: {
outDir,
Expand Down

0 comments on commit 76cbebd

Please sign in to comment.