Skip to content

Commit

Permalink
fix: support manually importing dist/server/importBuild.cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Sep 25, 2023
1 parent 2b4c030 commit 01b9ea5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions telefunc/node/vite/loadTelefuncFilesWithVite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ async function loadGlobImporter() {
}
return { moduleExports, viteProvider: 'viteDevServer' as const }
} else {
await loadServerBuild()
const moduleExports = await loadTelefuncFilesWithImportBuild()
assert(moduleExports)
let moduleExports: unknown
moduleExports = await loadTelefuncFilesWithImportBuild()
if (moduleExports === null) {
await loadServerBuild()
moduleExports = await loadTelefuncFilesWithImportBuild()
assert(moduleExports)
} else {
assert(moduleExports)
}
assertProd()
return { moduleExports, viteProvider: 'importBuild.cjs' as const }
}
Expand Down

0 comments on commit 01b9ea5

Please sign in to comment.