bare-module 3.0.7 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -410,21 +410,23 @@ exports.createRequire = function createRequire (parentURL, opts = {}) {
|
|
|
410
410
|
|
|
411
411
|
let {
|
|
412
412
|
referrer = null,
|
|
413
|
+
type = constants.types.SCRIPT,
|
|
414
|
+
defaultType = referrer ? referrer._defaultType : constants.types.SCRIPT,
|
|
415
|
+
cache = referrer ? referrer._cache : self._cache,
|
|
416
|
+
main = referrer ? referrer._main : null,
|
|
413
417
|
protocol = referrer ? referrer._protocol : self._protocols['file:'],
|
|
414
418
|
imports = referrer ? referrer._imports : null,
|
|
415
419
|
resolutions = referrer ? referrer._resolutions : null,
|
|
416
420
|
builtins = referrer ? referrer._builtins : null,
|
|
417
|
-
conditions = referrer ? referrer._conditions : self._conditions
|
|
418
|
-
main = referrer ? referrer._main : null,
|
|
419
|
-
defaultType = referrer ? referrer._defaultType : constants.types.SCRIPT,
|
|
420
|
-
type = constants.types.SCRIPT
|
|
421
|
+
conditions = referrer ? referrer._conditions : self._conditions
|
|
421
422
|
} = opts
|
|
422
423
|
|
|
423
424
|
const module = new Module(parentURL)
|
|
424
425
|
|
|
425
|
-
module._main = main || module
|
|
426
426
|
module._type = type
|
|
427
427
|
module._defaultType = defaultType
|
|
428
|
+
module._cache = cache
|
|
429
|
+
module._main = main || module
|
|
428
430
|
module._protocol = protocol
|
|
429
431
|
module._imports = imports
|
|
430
432
|
module._resolutions = resolutions
|