Skip to content

Commit d7c0a91

Browse files
committed
feat: preload built format adapt to esm
1 parent 700201b commit d7c0a91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/simple.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default async function electronSimple(options: ElectronSimpleOptions): Pr
5353
output: {
5454
// For use the Electron API - `import { contextBridge, ipcRenderer } from 'electron'`,
5555
// Note, however, that `preload.ts` should not be split. 🚧
56-
format: 'cjs',
56+
format: esmodule ? 'esm' : 'cjs',
5757

5858
// Whether Node.js is enabled in the Main process or not, the Preload scripts supports loading `electron` module,
5959
// so we need to build it in `cjs` format.

0 commit comments

Comments
 (0)