/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ module.exports = (request, options) => { // Call the defaultResolver, so we leverage its cache, error handling, etc. return options.defaultResolver(request, { ...options, // Use packageFilter to process parsed `package.json` before the resolution (see https://www.npmjs.com/package/resolve#resolveid-opts-cb) packageFilter: (pkg) => { return { ...pkg, // Alter the value of `main` before resolving the package, so jest to try different entry points in the specified order. main: pkg.flipperBundlerEntry || pkg.main, }; }, }); };