Skip to content

Instantly share code, notes, and snippets.

@stolinski
Created February 2, 2021 17:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stolinski/b60484177dd4810335c8363c2a97ff1e to your computer and use it in GitHub Desktop.
Save stolinski/b60484177dd4810335c8363c2a97ff1e to your computer and use it in GitHub Desktop.
Patch to fix mongoose for esbuild
diff --git a/node_modules/mongoose/lib/index.js b/node_modules/mongoose/lib/index.js
index 1425cfa..631eba5 100644
--- a/node_modules/mongoose/lib/index.js
+++ b/node_modules/mongoose/lib/index.js
@@ -732,19 +732,19 @@ Mongoose.prototype.connections;
* Driver dependent APIs
*/
-const driver = global.MONGOOSE_DRIVER_PATH || './drivers/node-mongodb-native';
+
/*!
* Connection
*/
-const Connection = require(driver + '/connection');
+const Connection = require('./drivers/node-mongodb-native/connection');
/*!
* Collection
*/
-const Collection = require(driver + '/collection');
+const Collection = require('./drivers/node-mongodb-native/collection');
/**
* The Mongoose Aggregate constructor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment