(_user, _env)
| 85 | name: 'ns-angular-prelink', |
| 86 | enforce: 'pre', |
| 87 | async config(_user, _env) { |
| 88 | const debug = process.env.VITE_DEBUG_LOGS === 'true' || process.env.VITE_DEBUG_LOGS === '1'; |
| 89 | const disabled = process.env.NS_PRELINK === '0' || process.env.NS_PRELINK === 'false'; |
| 90 | if (disabled) return {}; |
| 91 | // Prelink synchronously to ensure alias points to ready files. |
| 92 | for (const pkg of pkgs) { |
| 93 | await prelinkPackage(req, pkg, cacheRoot, !!debug); |
| 94 | } |
| 95 | done = true; |
| 96 | const alias = [ |
| 97 | { find: /^@angular\//, replacement: path.join(cacheRoot, '@angular') + '/' }, |
| 98 | { find: /^@nativescript\/angular(\/.*)?$/, replacement: (_: string, sub: string) => path.join(cacheRoot, '@nativescript', 'angular') + (sub || '') }, |
| 99 | ] as any; |
| 100 | return { resolve: { alias } }; |
| 101 | }, |
| 102 | async buildStart() { |
| 103 | if (done) return; |
| 104 | const disabled = process.env.NS_PRELINK === '0' || process.env.NS_PRELINK === 'false'; |
nothing calls this directly
no test coverage detected