bare-module 1.14.4 → 1.14.5

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 +4 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -238,7 +238,7 @@ module.exports = exports = class Module {
238
238
 
239
239
  if (this._cache[specifier]) return this._transform(this._cache[specifier], referrer, dynamic)
240
240
 
241
- const bundle = this._bundleFor(path.dirname(specifier), protocol, source)
241
+ const bundle = this._bundleFor(path.dirname(specifier), protocol)
242
242
 
243
243
  if (bundle) {
244
244
  protocol = new Protocol({
@@ -699,6 +699,8 @@ exports._extensions['.node'] = function (module, source, referrer, protocol, imp
699
699
  }
700
700
 
701
701
  exports._extensions['.bundle'] = function (module, source, referrer, protocol, imports) {
702
+ if (source === null) source = protocol.read(module._filename)
703
+
702
704
  if (typeof source === 'string') source = Buffer.from(source)
703
705
 
704
706
  const bundle = this._bundleFor(module._filename, protocol, source)
@@ -711,7 +713,7 @@ exports._extensions['.bundle'] = function (module, source, referrer, protocol, i
711
713
 
712
714
  exports._protocols['file:'] = new Protocol({
713
715
  preresolve (specifier) {
714
- return path.normalize(specifier.replace(/^file:/, ''))
716
+ return specifier.replace(/^file:/, '')
715
717
  },
716
718
 
717
719
  postresolve (specifier) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module",
3
- "version": "1.14.4",
3
+ "version": "1.14.5",
4
4
  "description": "Module support for JavaScript",
5
5
  "main": "index.js",
6
6
  "files": [