Socket
Socket
Sign inDemoInstall

@rollup/plugin-node-resolve

Package Overview
Dependencies
Maintainers
4
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rollup/plugin-node-resolve - npm Package Compare versions

Comparing version 13.3.0 to 14.0.0

73

dist/cjs/index.js

@@ -24,3 +24,3 @@ 'use strict';

var version = "13.3.0";
var version = "14.0.0";

@@ -995,3 +995,3 @@ util.promisify(fs__default["default"].access);

const doResolveId = async (context, importee, importer, custom) => {
const resolveLikeNode = async (context, importee, importer, custom) => {
// strip query params from import

@@ -1171,35 +1171,48 @@ const [importPath, params] = importee.split('?');

async resolveId(importee, importer, resolveOptions) {
if (importee === ES6_BROWSER_EMPTY) {
return importee;
}
// ignore IDs with null character, these belong to other plugins
if (/\0/.test(importee)) return null;
resolveId: {
order: 'post',
async handler(importee, importer, resolveOptions) {
if (importee === ES6_BROWSER_EMPTY) {
return importee;
}
// ignore IDs with null character, these belong to other plugins
if (/\0/.test(importee)) return null;
if (/\0/.test(importer)) {
importer = undefined;
}
const { custom = {} } = resolveOptions;
const { 'node-resolve': { resolved: alreadyResolved } = {} } = custom;
if (alreadyResolved) {
return alreadyResolved;
}
const resolved = await doResolveId(this, importee, importer, resolveOptions.custom);
if (resolved) {
const resolvedResolved = await this.resolve(
resolved.id,
importer,
Object.assign({ skipSelf: true }, resolveOptions)
);
if (resolvedResolved) {
// Handle plugins that manually make the result external
if (resolvedResolved.external) {
return false;
if (/\0/.test(importer)) {
importer = undefined;
}
const resolved = await resolveLikeNode(this, importee, importer, custom);
if (resolved) {
// This way, plugins may attach additional meta information to the
// resolved id or make it external. We do not skip node-resolve here
// because another plugin might again use `this.resolve` in its
// `resolveId` hook, in which case we want to add the correct
// `moduleSideEffects` information.
const resolvedResolved = await this.resolve(resolved.id, importer, {
...resolveOptions,
custom: { ...custom, 'node-resolve': { resolved } }
});
if (resolvedResolved) {
// Handle plugins that manually make the result external
if (resolvedResolved.external) {
return false;
}
// Allow other plugins to take over resolution. Rollup core will not
// change the id if it corresponds to an existing file
if (resolvedResolved.id !== resolved.id) {
return resolvedResolved;
}
// Pass on meta information added by other plugins
return { ...resolved, meta: resolvedResolved.meta };
}
// Allow other plugins to take over resolution. Rollup core will not
// change the id if it corresponds to an existing file
if (resolvedResolved.id !== resolved.id) {
return resolvedResolved;
}
// Pass on meta information added by other plugins
return { ...resolved, meta: resolvedResolved.meta };
}
return resolved;
}
return resolved;
},

@@ -1206,0 +1219,0 @@

@@ -11,3 +11,3 @@ import path, { dirname, resolve, extname, normalize, sep } from 'path';

var version = "13.3.0";
var version = "14.0.0";

@@ -982,3 +982,3 @@ promisify(fs.access);

const doResolveId = async (context, importee, importer, custom) => {
const resolveLikeNode = async (context, importee, importer, custom) => {
// strip query params from import

@@ -1158,35 +1158,48 @@ const [importPath, params] = importee.split('?');

async resolveId(importee, importer, resolveOptions) {
if (importee === ES6_BROWSER_EMPTY) {
return importee;
}
// ignore IDs with null character, these belong to other plugins
if (/\0/.test(importee)) return null;
resolveId: {
order: 'post',
async handler(importee, importer, resolveOptions) {
if (importee === ES6_BROWSER_EMPTY) {
return importee;
}
// ignore IDs with null character, these belong to other plugins
if (/\0/.test(importee)) return null;
if (/\0/.test(importer)) {
importer = undefined;
}
const { custom = {} } = resolveOptions;
const { 'node-resolve': { resolved: alreadyResolved } = {} } = custom;
if (alreadyResolved) {
return alreadyResolved;
}
const resolved = await doResolveId(this, importee, importer, resolveOptions.custom);
if (resolved) {
const resolvedResolved = await this.resolve(
resolved.id,
importer,
Object.assign({ skipSelf: true }, resolveOptions)
);
if (resolvedResolved) {
// Handle plugins that manually make the result external
if (resolvedResolved.external) {
return false;
if (/\0/.test(importer)) {
importer = undefined;
}
const resolved = await resolveLikeNode(this, importee, importer, custom);
if (resolved) {
// This way, plugins may attach additional meta information to the
// resolved id or make it external. We do not skip node-resolve here
// because another plugin might again use `this.resolve` in its
// `resolveId` hook, in which case we want to add the correct
// `moduleSideEffects` information.
const resolvedResolved = await this.resolve(resolved.id, importer, {
...resolveOptions,
custom: { ...custom, 'node-resolve': { resolved } }
});
if (resolvedResolved) {
// Handle plugins that manually make the result external
if (resolvedResolved.external) {
return false;
}
// Allow other plugins to take over resolution. Rollup core will not
// change the id if it corresponds to an existing file
if (resolvedResolved.id !== resolved.id) {
return resolvedResolved;
}
// Pass on meta information added by other plugins
return { ...resolved, meta: resolvedResolved.meta };
}
// Allow other plugins to take over resolution. Rollup core will not
// change the id if it corresponds to an existing file
if (resolvedResolved.id !== resolved.id) {
return resolvedResolved;
}
// Pass on meta information added by other plugins
return { ...resolved, meta: resolvedResolved.meta };
}
return resolved;
}
return resolved;
},

@@ -1193,0 +1206,0 @@

{
"name": "@rollup/plugin-node-resolve",
"version": "13.3.0",
"version": "14.0.0",
"publishConfig": {

@@ -55,3 +55,3 @@ "access": "public"

"peerDependencies": {
"rollup": "^2.42.0"
"rollup": "^2.78.0"
},

@@ -70,6 +70,6 @@ "dependencies": {

"@rollup/plugin-babel": "^5.1.0",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-json": "^4.1.0",
"es5-ext": "^0.10.53",
"rollup": "^2.67.3",
"rollup": "^2.78.1",
"source-map": "^0.7.3",

@@ -76,0 +76,0 @@ "string-capitalize": "^1.0.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc