MCPcopy Create free account
hub / github.com/esengine/esengine / resolveId

Function resolveId

packages/build-config/src/plugins/block-editor.ts:76–98  ·  view source on GitHub ↗
(source: string, importer: string | undefined)

Source from the content-addressed store, hash-verified

74 enforce: 'pre',
75
76 resolveId(source: string, importer: string | undefined) {
77 if (isBlocked(source)) {
78 const message = `[block-editor] Editor dependency detected in runtime build:\n` +
79 ` Source: ${source}\n` +
80 ` Importer: ${importer || 'entry'}\n` +
81 `\n` +
82 ` This usually means:\n` +
83 ` 1. A runtime module is importing from a non-/runtime path\n` +
84 ` 2. An editor-only dependency leaked into the dependency chain\n` +
85 `\n` +
86 ` Fix: Change the import to use /runtime subpath, e.g.:\n` +
87 ` import { X } from '@esengine/ui/runtime' // ✓\n` +
88 ` import { X } from '@esengine/ui' // ✗`;
89
90 if (bWarnOnly) {
91 console.warn('\x1b[33m' + message + '\x1b[0m');
92 return { id: source, external: true };
93 } else {
94 throw new Error(message);
95 }
96 }
97 return null;
98 }
99 };
100}

Callers 5

kahnSortFunction · 0.85
visitFunction · 0.85
validateDependenciesFunction · 0.85
collectFunction · 0.85
getReverseDependenciesFunction · 0.85

Calls 2

isBlockedFunction · 0.85
warnMethod · 0.45

Tested by

no test coverage detected