Skip to content

Commit 86dd639

Browse files
committed
chore: fix unit test
1 parent bca2d36 commit 86dd639

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/merge/src/postinstall.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,14 @@ function ensureVariant(distDir: string, variant: RuntimeVariant): {
211211

212212
function main() {
213213
const resolveDistDir = (): string => {
214-
// When executed via the CJS bundle (loaded through the bootstrap script), __dirname is available
215214
if (typeof __dirname === 'string') {
216-
return __dirname
215+
return path.resolve(__dirname, '../dist')
217216
}
218217

219-
// Fallback for the ESM bundle evaluated directly
218+
// Fallback for the ESM bundle or direct TS execution
220219
// eslint-disable-next-line no-new-func
221220
const getImportMetaUrl = new Function('return import.meta.url') as () => string
222-
return fileURLToPath(new URL('./', getImportMetaUrl()))
221+
return fileURLToPath(new URL('../dist/', getImportMetaUrl()))
223222
}
224223

225224
const distDir = resolveDistDir()

0 commit comments

Comments
 (0)