Subdomain-Vorschlag und Zuweisungs-Logik mit Tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c24b3d43c8
commit
cc59e7978e
6 files changed
+174
-1
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import esbuild from 'esbuild'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
const repoRoot = path.resolve(__dirname, '../..')
|
||||
|
||||
export async function loadModule(relPathFromRepoRoot) {
|
||||
const entryPoint = path.join(repoRoot, relPathFromRepoRoot)
|
||||
const result = await esbuild.build({
|
||||
entryPoints: [entryPoint],
|
||||
bundle: true,
|
||||
format: 'esm',
|
||||
write: false,
|
||||
platform: 'neutral',
|
||||
})
|
||||
const code = result.outputFiles[0].text
|
||||
const dataUrl = `data:text/javascript;base64,${Buffer.from(code).toString('base64')}`
|
||||
return import(dataUrl)
|
||||
}
|
||||
Reference in new issue
Block a user