Skip to content

Commit 95cb747

Browse files
committed
fix: clear mock index.html after building complete
1 parent 6e0887b commit 95cb747

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,6 @@ export default function electron(options: ElectronOptions | ElectronOptions[]):
280280
}
281281
},
282282
async closeBundle() {
283-
// Remove mock files created in configResolved before building Electron.
284-
if (cleanupMock) {
285-
await cleanupMock()
286-
cleanupMock = undefined
287-
}
288-
289283
for (const options of optionsArray) {
290284
options.vite ??= {}
291285
options.vite.mode ??= configEnv.mode
@@ -294,6 +288,12 @@ export default function electron(options: ElectronOptions | ElectronOptions[]):
294288
options.vite.envPrefix ??= userConfig.envPrefix
295289
await build(options)
296290
}
291+
292+
// Remove mock files created in configResolved before building Electron.
293+
if (cleanupMock) {
294+
await cleanupMock()
295+
cleanupMock = undefined
296+
}
297297
},
298298
},
299299
]

test/utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { builtinModules } from 'node:module'
33
import type { InlineConfig } from 'vite'
44
import { describe, expect, it } from 'vitest'
55

6-
import { withExternalBuiltins } from '..'
6+
import { withExternalBuiltins } from '../src/index'
77
import type { RolldownOptions } from '../src/utils'
88

99
type ExternalOption = RolldownOptions['external']

0 commit comments

Comments
 (0)