1import { ok, deepStrictEqual } from 'assert'; 2 3export async function resolve(specifier, context, defaultResolve) { 4 ok(Array.isArray(context.conditions), 'loader receives conditions array'); 5 6 deepStrictEqual([...context.conditions].sort(), [ 7 'import', 8 'node', 9 'node-addons', 10 ]); 11 12 return defaultResolve(specifier, { 13 ...context, 14 conditions: ['custom-condition', ...context.conditions], 15 }); 16} 17