Created
February 12, 2021 10:40
-
-
Save hugdru/982a31d929a030e29f852c4bfafd9b16 to your computer and use it in GitHub Desktop.
mongoose patch workaround for esbuild and parcel - created and applied automatically by patch-package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/mongoose/lib/index.js b/node_modules/mongoose/lib/index.js | |
index 80a8ca5..cc3d2b4 100644 | |
--- a/node_modules/mongoose/lib/index.js | |
+++ b/node_modules/mongoose/lib/index.js | |
@@ -4,16 +4,7 @@ | |
* Module dependencies. | |
*/ | |
-if (global.MONGOOSE_DRIVER_PATH) { | |
- const deprecationWarning = 'The `MONGOOSE_DRIVER_PATH` global property is ' + | |
- 'deprecated. Use `mongoose.driver.set()` instead.'; | |
- const setDriver = require('util').deprecate(function() { | |
- require('./driver').set(require(global.MONGOOSE_DRIVER_PATH)); | |
- }, deprecationWarning); | |
- setDriver(); | |
-} else { | |
- require('./driver').set(require('./drivers/node-mongodb-native')); | |
-} | |
+require('./driver').set(require('./drivers/node-mongodb-native')); | |
const Document = require('./document'); | |
const Schema = require('./schema'); | |
@@ -722,23 +713,17 @@ Mongoose.prototype.__defineSetter__('connection', function(v) { | |
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