bare-module 3.0.9 → 3.0.10

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 +9 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -8,6 +8,8 @@ const constants = require('./lib/constants')
8
8
  const errors = require('./lib/errors')
9
9
  const binding = require('./binding')
10
10
 
11
+ const { startsWithWindowsDriveLetter } = resolve
12
+
11
13
  const Module = module.exports = exports = class Module {
12
14
  constructor (url) {
13
15
  this._url = url
@@ -414,7 +416,13 @@ exports.isBuiltin = function isBuiltin () {
414
416
  exports.createRequire = function createRequire (parentURL, opts = {}) {
415
417
  const self = Module
416
418
 
417
- if (typeof parentURL === 'string') parentURL = new URL(parentURL, 'file:')
419
+ if (typeof parentURL === 'string') {
420
+ if (startsWithWindowsDriveLetter(parentURL)) {
421
+ parentURL = '/' + parentURL
422
+ }
423
+
424
+ parentURL = new URL(parentURL, 'file:')
425
+ }
418
426
 
419
427
  let {
420
428
  referrer = null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "Module support for JavaScript",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -26,7 +26,7 @@
26
26
  "homepage": "https://github.com/holepunchto/bare-module#readme",
27
27
  "dependencies": {
28
28
  "bare-bundle": "^0.4.0",
29
- "bare-module-resolve": "^1.4.1",
29
+ "bare-module-resolve": "^1.4.4",
30
30
  "bare-path": "^2.0.0",
31
31
  "bare-url": "^0.3.4"
32
32
  },