fix: openclaw module loading (#993)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Haze <hazeone@users.noreply.github.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
import 'zx/globals';
|
||||
import { EXTRA_BUNDLED_PACKAGES } from './openclaw-bundle-config.mjs';
|
||||
import { patchExtensionOpenClawSelfImports } from './openclaw-self-import-patch.mjs';
|
||||
|
||||
const ROOT = path.resolve(__dirname, '..');
|
||||
const OUTPUT = path.join(ROOT, 'build', 'openclaw');
|
||||
@@ -973,6 +974,11 @@ function patchBundledRuntime(outputDir) {
|
||||
patchBrokenModules(outputNodeModules);
|
||||
patchBundledRuntime(OUTPUT);
|
||||
|
||||
const openclawSelfImportPatch = patchExtensionOpenClawSelfImports(OUTPUT);
|
||||
if (openclawSelfImportPatch.specifiersPatched > 0) {
|
||||
echo` 🩹 Rewrote ${openclawSelfImportPatch.specifiersPatched} OpenClaw plugin-sdk self-import(s) in ${openclawSelfImportPatch.filesPatched} extension file(s)`;
|
||||
}
|
||||
|
||||
// 8. Verify the bundle
|
||||
const entryExists = fs.existsSync(path.join(OUTPUT, 'openclaw.mjs'));
|
||||
const distExists = fs.existsSync(path.join(OUTPUT, 'dist', 'entry.js'));
|
||||
|
||||
Reference in New Issue
Block a user