Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-plugins-node-modules-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
366
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugins-node-modules-polyfill - npm Package Compare versions

Comparing version 1.6.1-next.f7bc443.0 to 1.6.1

15

CHANGELOG.md

@@ -5,2 +5,17 @@ # Changelog

# [1.6.1](https://github.com/imranbarbhuiya/esbuild-plugins-node-modules-polyfill/compare/v1.6.0...v1.6.1) - (2023-08-29)
## 🐛 Bug Fixes
- Dont bundle the content ([5ad8f06](https://github.com/imranbarbhuiya/esbuild-plugins-node-modules-polyfill/commit/5ad8f06bb48dc9174f9b17e4f5ffcfc27368950f))
## 📝 Documentation
- Add modules to global polyfills usage (#157) ([54e8d46](https://github.com/imranbarbhuiya/esbuild-plugins-node-modules-polyfill/commit/54e8d469829d9900df3bb8f9a3169fa3aac2307c))
## 🧪 Testing
- Use consistent folder structure for fixtures (#158) ([776d755](https://github.com/imranbarbhuiya/esbuild-plugins-node-modules-polyfill/commit/776d755839c8ace60e35716cd4271897e0da8d47))
- Ensure tree-shaken modules avoid fallback (#156) ([f6da65b](https://github.com/imranbarbhuiya/esbuild-plugins-node-modules-polyfill/commit/f6da65b12cf27a8813f4273d69d0b23034032f5a))
# [1.6.0](https://github.com/imranbarbhuiya/esbuild-plugins-node-modules-polyfill/compare/v1.5.0...v1.6.0) - (2023-08-25)

@@ -7,0 +22,0 @@

17

dist/index.js

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

var localPkg = require('local-pkg');
var esbuild = require('esbuild');
var promises = require('fs/promises');
var resolve_exports = require('resolve.exports');

@@ -41,3 +41,3 @@

__require.resolve(`@jspm/core/nodelibs/${importPath}`),
// ensure "fs/promises" is resolved properly
// ensure sub path modules are resolved properly
"../../.." + (importPath.includes("/") ? "/.." : "")

@@ -71,8 +71,3 @@ );

const exportFullPath = await getCachedPolyfillPath(importPath);
const content = (await esbuild.build({
write: false,
format: "esm",
bundle: true,
entryPoints: [exportFullPath]
})).outputFiles[0].text;
const content = await promises.readFile(exportFullPath, "utf8");
return content.replace(/eval\(/g, "(0,eval)(");

@@ -260,8 +255,2 @@ }, "polyfillContentAndTransform");

}, "nodeModulesPolyfillPlugin");
/**
* `polyfillPath` and `getCachedPolyfillContent` are taken from below source with some modifications for my use case.
* https://github.com/Aslemammad/modern-node-polyfills
* @author Aslemammad
* @license MIT
*/

@@ -268,0 +257,0 @@ exports.commonJsTemplate = commonJsTemplate;

{
"name": "esbuild-plugins-node-modules-polyfill",
"version": "1.6.1-next.f7bc443.0",
"version": "1.6.1",
"description": "Polyfills nodejs builtin modules and globals for the browser.",

@@ -45,3 +45,3 @@ "main": "dist/index.js",

"esbuild": "^0.19.2",
"eslint": "^8.47.0",
"eslint": "^8.48.0",
"eslint-config-mahir": "^0.0.31",

@@ -53,4 +53,4 @@ "husky": "^8.0.3",

"tsup": "^7.2.0",
"typescript": "^5.1.6",
"vitest": "^0.34.2"
"typescript": "^5.2.2",
"vitest": "^0.34.3"
},

@@ -91,3 +91,3 @@ "peerDependencies": {

},
"packageManager": "yarn@3.6.2",
"packageManager": "yarn@3.6.3",
"engines": {

@@ -94,0 +94,0 @@ "node": ">=14.0.0"

@@ -60,2 +60,5 @@ <div align="center">

> **Note**
> If you are utilizing the [`modules`][#configure-which-modules-to-polyfill] option, ensure that you include polyfills for the global modules you are using.
### Configure which modules to polyfill:

@@ -62,0 +65,0 @@

Sorry, the diff of this file is not supported yet

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