()
| 13 | * @internal |
| 14 | */ |
| 15 | export function applyExternalConfigs() { |
| 16 | for (const dependency of getAllDependencies()) { |
| 17 | const packagePath = getDependencyPath(dependency); |
| 18 | |
| 19 | if (!packagePath) { |
| 20 | continue; |
| 21 | } |
| 22 | |
| 23 | const configPath = path.join(packagePath, 'nativescript.vite.mjs'); |
| 24 | |
| 25 | if (fs.existsSync(configPath)) { |
| 26 | console.log(`Found and merged in external config: ${configPath}`); |
| 27 | |
| 28 | try { |
| 29 | const externalModule = require(configPath); |
| 30 | const externalConfig = externalModule?.default ?? externalModule; |
| 31 | externalConfigMerges.push(externalConfig()); |
| 32 | } catch (err) { |
| 33 | console.warn(` |
| 34 | Unable to apply config: ${configPath}. |
| 35 | Error is: ${err} |
| 36 | `); |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | } |
no test coverage detected