Socket
Socket
Sign inDemoInstall

@yarnpkg/esbuild-plugin-pnp

Package Overview
Dependencies
Maintainers
6
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yarnpkg/esbuild-plugin-pnp - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

30

lib/index.js

@@ -29,4 +29,13 @@ "use strict";

else {
if (path === external) {
if (path === external)
return true;
// If the module "foo" has been marked as external, we also want to treat
// paths into that module such as "foo/bar" as external too.
// References:
// - https://github.com/evanw/esbuild/blob/537195ae84bee1510fac14235906d588084c39cd/internal/resolver/resolver.go#L651-L652
// - https://github.com/evanw/esbuild/blob/537195ae84bee1510fac14235906d588084c39cd/internal/resolver/resolver.go#L1688-L1691
if (!external.startsWith(`/`) && !external.startsWith(`./`) && !external.startsWith(`../`) && external !== `.` && external !== `..`) {
if (path.startsWith(`${external}/`)) {
return true;
}
}

@@ -80,3 +89,13 @@ }

const externals = parseExternals((_a = build.initialOptions.external) !== null && _a !== void 0 ? _a : []);
const isPlatformNode = ((_b = build.initialOptions.platform) !== null && _b !== void 0 ? _b : `browser`) === `node`;
const platform = (_b = build.initialOptions.platform) !== null && _b !== void 0 ? _b : `browser`;
const isPlatformNode = platform === `node`;
// Reference: https://github.com/evanw/esbuild/blob/537195ae84bee1510fac14235906d588084c39cd/internal/resolver/resolver.go#L238-L253
const conditionsDefault = new Set(build.initialOptions.conditions);
conditionsDefault.add(`default`);
if (platform === `browser` || platform === `node`)
conditionsDefault.add(platform);
const conditionsImport = new Set(conditionsDefault);
conditionsImport.add(`import`);
const conditionsRequire = new Set(conditionsDefault);
conditionsRequire.add(`require`);
build.onResolve({ filter }, args => {

@@ -86,2 +105,8 @@ var _a, _b;

return { external: true };
// Reference: https://github.com/evanw/esbuild/blob/537195ae84bee1510fac14235906d588084c39cd/internal/resolver/resolver.go#L1495-L1502
let conditions = conditionsDefault;
if (args.kind === `dynamic-import` || args.kind === `import-statement`)
conditions = conditionsImport;
else if (args.kind === `require-call` || args.kind === `require-resolve`)
conditions = conditionsRequire;
// The entry point resolution uses an empty string

@@ -99,2 +124,3 @@ const effectiveImporter = args.importer

path = pnpApi.resolveRequest(args.path, effectiveImporter, {
conditions,
considerBuiltins: isPlatformNode,

@@ -101,0 +127,0 @@ extensions,

4

package.json
{
"name": "@yarnpkg/esbuild-plugin-pnp",
"version": "2.0.1",
"version": "2.0.2",
"license": "BSD-2-Clause",

@@ -13,3 +13,3 @@ "main": "./lib/index.js",

"devDependencies": {
"@yarnpkg/pnp": "^3.2.0",
"@yarnpkg/pnp": "^3.2.1",
"esbuild": "npm:esbuild-wasm@^0.11.20"

@@ -16,0 +16,0 @@ },

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