From 9ca5b27977d3669c21237797a8baff245f164ccb Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 31 May 2017 20:53:35 -0400 Subject: [PATCH] Replace useless core-util-is module with empty stub. Loading this package triggers a ReferenceError if Buffer is not globally defined. However, this package never uses Buffer.isBuffer, and in fact none of this package's properties are ever used by any other packages in meteor-node-stubs, so it seems safe to replace it with an empty stub. --- map.json | 1 + package.json | 3 ++- scripts/rm-core-utils.js | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 scripts/rm-core-utils.js diff --git a/map.json b/map.json index 96c88caab8..704f1326aa 100644 --- a/map.json +++ b/map.json @@ -6,6 +6,7 @@ "console": "console-browserify", "constants": "constants-browserify", "crypto": "crypto-browserify", + "core-util-is": null, "dgram": null, "dns": null, "domain": "domain-browser", diff --git a/package.json b/package.json index 3fb2f783fc..76661f25f6 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "main": "index.js", "license": "MIT", "scripts": { - "prepublish": "node scripts/build-deps.js" + "prepublish": "node scripts/build-deps.js", + "postinstall": "node scripts/rm-core-utils.js" }, "dependencies": { "assert": "^1.4.1", diff --git a/scripts/rm-core-utils.js b/scripts/rm-core-utils.js new file mode 100644 index 0000000000..3f5cce5b6a --- /dev/null +++ b/scripts/rm-core-utils.js @@ -0,0 +1,3 @@ +require("rimraf").sync(require("path").join( + __dirname, "..", "node_modules", "**", "core-util-is" +));