11cb0ef41Sopenharmony_ciimport { writeSync } from 'node:fs'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciexport async function resolve(specifier, context, next) { 41cb0ef41Sopenharmony_ci // This check is needed to make sure that we don't prevent the 51cb0ef41Sopenharmony_ci // resolution from follow-up loaders. It wouldn't be a problem 61cb0ef41Sopenharmony_ci // in real life because loaders aren't supposed to break the 71cb0ef41Sopenharmony_ci // resolution, but the ones used in our tests do, for convenience. 81cb0ef41Sopenharmony_ci if (specifier === 'node:fs' || specifier.includes('loader')) { 91cb0ef41Sopenharmony_ci return next(specifier); 101cb0ef41Sopenharmony_ci } 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci writeSync(1, 'resolve passthru' + '\n'); // Signal that this specific hook ran 131cb0ef41Sopenharmony_ci return next(specifier); 141cb0ef41Sopenharmony_ci} 15