bare-module 1.9.3 → 1.9.4
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 +4 -4
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/addon.bare +0 -0
package/index.js
CHANGED
|
@@ -209,7 +209,7 @@ const Module = module.exports = class Module {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
static * _resolveNodeModules (specifier, dirname, protocol) {
|
|
212
|
-
for (const nodeModules of this.
|
|
212
|
+
for (const nodeModules of this._resolveNodeModulesPaths(dirname)) {
|
|
213
213
|
const filename = path.join(nodeModules, specifier)
|
|
214
214
|
|
|
215
215
|
yield * this._resolveFile(filename, protocol)
|
|
@@ -217,7 +217,7 @@ const Module = module.exports = class Module {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
static *
|
|
220
|
+
static * _resolveNodeModulesPaths (start) {
|
|
221
221
|
if (start === path.sep) return yield path.join(start, 'node_modules')
|
|
222
222
|
|
|
223
223
|
const parts = start.split(path.sep)
|
|
@@ -299,8 +299,8 @@ Module._extensions['.js'] = function (module, source, referrer, protocol, import
|
|
|
299
299
|
// The package is explicitly declared as an ES module.
|
|
300
300
|
(module._info && module._info.type === 'module') ||
|
|
301
301
|
|
|
302
|
-
// The referrer is itself an ES module.
|
|
303
|
-
(referrer && referrer._type === 'esm')
|
|
302
|
+
// The source is a data: URI and the referrer is itself an ES module.
|
|
303
|
+
(protocol === this._protocols['data:'] && referrer && referrer._type === 'esm')
|
|
304
304
|
)
|
|
305
305
|
|
|
306
306
|
const loader = this._extensions[isESM ? '.mjs' : '.cjs']
|
package/package.json
CHANGED
|
Binary file
|