bare-module 2.5.3 → 2.5.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.
Files changed (2) hide show
  1. package/index.js +2 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -409,6 +409,7 @@ const Module = module.exports = exports = class Module {
409
409
  resolved = this._mapConditionalSpecifier(resolved, conditions, info.imports)
410
410
 
411
411
  if (resolved) dirname = path.dirname(pkg._filename)
412
+ else resolved = specifier
412
413
  }
413
414
 
414
415
  if (protocol.imports) {
@@ -815,7 +816,7 @@ Module._protocols['file:'] = new Protocol({
815
816
  preresolve (specifier, dirname) {
816
817
  specifier = specifier.replace(/^file:/, '')
817
818
 
818
- if (/^\.(\/|\\)/.test(specifier)) specifier = path.join(dirname, specifier)
819
+ if (specifier === '.' || specifier.startsWith('./') || specifier.startsWith('.\\')) specifier = path.join(dirname, specifier)
819
820
  else if (path.isAbsolute(specifier)) specifier = path.normalize(specifier)
820
821
 
821
822
  return specifier
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "Module support for JavaScript",
5
5
  "main": "index.js",
6
6
  "files": [