(source: string, importer: string | undefined)
| 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 | } |
no test coverage detected