(node: ImportNode | ExportNode)
| 78 | } |
| 79 | |
| 80 | function findImport(node: ImportNode | ExportNode) { |
| 81 | const source = node.source; |
| 82 | if (!source || !isStringLiteral(source)) return; |
| 83 | const name = decodeURI(getStringLiteralValue(source)); |
| 84 | const method = node.type === "ImportExpression" ? "dynamic" : "static"; |
| 85 | if (isPathImport(name)) { |
| 86 | const localPath = resolveLocalPath(path, name); |
| 87 | if (!localPath) throw syntaxError(`non-local import: ${name}`, node, input); // prettier-ignore |
| 88 | addImport({name: relativePath(path, localPath), type: "local", method}); |
| 89 | } else { |
| 90 | addImport({name, type: "global", method}); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | function findImportMetaResolve(node: CallExpression) { |
| 95 | const source = node.arguments[0]; |
nothing calls this directly
no test coverage detected