You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.
As of right now this plugin cannot be used as a drop-in for rollup-plugin-node-resolve because it ignores mainfields. It was mentioned in webpack/enhanced-resolve#162 (comment) that this should be done in a separate plugin but mainfields used throughout many packages to identify commonJS and ES module builds while extensions are rarely used to identify these.
Would you consider adding support for a mainFields option to this plugin? I would like to put together a pull request for this.
Right now I'm using this custom jest resolver
/** * Uses the specified mainField with PnP resolution * @param {string} request * @param {string} mainField * @param {JestResolverOptions} resolverOptions */functionresolveMainField(request,mainField,resolverOptions){constissuer=`${resolverOptions.basedir}/`;constlocation=pnp.resolveToUnqualified(request,issuer,{extensions: resolverOptions.extensions,});/* * intuitevly packageInformation points to @material-ui/core's package.json * but it returns the workspace root const locator = pnp.findPackageLocator(location); const packageInformation = pnp.getPackageInformation(locator); */constpackageJson=fse.readJsonSync(path.resolve(location,'./package.json'),);constresolution=path.resolve(location,packageJson[mainField]);returnresolution;}
Overall I feel like I'm missing something because this goes back to resolve-by-filesystem. Shouldn't this information be available via pnpapi?
The text was updated successfully, but these errors were encountered:
As of right now this plugin cannot be used as a drop-in for rollup-plugin-node-resolve because it ignores mainfields. It was mentioned in webpack/enhanced-resolve#162 (comment) that this should be done in a separate plugin but mainfields used throughout many packages to identify commonJS and ES module builds while extensions are rarely used to identify these.
Would you consider adding support for a
mainFields
option to this plugin? I would like to put together a pull request for this.Right now I'm using this custom jest resolver
Overall I feel like I'm missing something because this goes back to resolve-by-filesystem. Shouldn't this information be available via pnpapi?
The text was updated successfully, but these errors were encountered: