(config: Config, plugin: Plugin, path: string)
| 194 | } |
| 195 | |
| 196 | export function getFilePath(config: Config, plugin: Plugin, path: string): string { |
| 197 | if (path.startsWith('node_modules')) { |
| 198 | let pathSegments = path.split('/').slice(1); |
| 199 | if (pathSegments[0].startsWith('@')) { |
| 200 | pathSegments = [pathSegments[0] + '/' + pathSegments[1], ...pathSegments.slice(2)]; |
| 201 | } |
| 202 | |
| 203 | const filePath = resolveNode(config.app.rootDir, ...pathSegments); |
| 204 | if (!filePath) { |
| 205 | throw new Error(`Can't resolve module ${pathSegments[0]}`); |
| 206 | } |
| 207 | |
| 208 | return filePath; |
| 209 | } |
| 210 | return join(plugin.rootPath, path); |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * For a given plugin, return all the plugin.xml elements with elementName, checking root and specified platform |
no test coverage detected