bare-module 3.1.10 → 3.1.11
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 +23 -23
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -373,33 +373,33 @@ const Module = module.exports = exports = class Module {
|
|
|
373
373
|
|
|
374
374
|
const module = cache[url.href] = new Module(url)
|
|
375
375
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
376
|
+
try {
|
|
377
|
+
switch (url.protocol) {
|
|
378
|
+
case 'builtin:':
|
|
379
|
+
module._exports = builtins[url.pathname]
|
|
380
|
+
break
|
|
380
381
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
382
|
+
default: {
|
|
383
|
+
module._defaultType = defaultType
|
|
384
|
+
module._cache = cache
|
|
385
|
+
module._main = main || module
|
|
386
|
+
module._protocol = protocol
|
|
387
|
+
module._imports = imports
|
|
388
|
+
module._resolutions = resolutions
|
|
389
|
+
module._builtins = builtins
|
|
390
|
+
module._conditions = conditions
|
|
391
|
+
|
|
392
|
+
let extension = self._extensionFor(type) || path.extname(url.pathname)
|
|
393
|
+
|
|
394
|
+
if (extension in self._extensions === false) {
|
|
395
|
+
if (defaultType) extension = self._extensionFor(defaultType) || '.js'
|
|
396
|
+
else extension = '.js'
|
|
397
|
+
}
|
|
397
398
|
|
|
398
|
-
|
|
399
|
+
self._extensions[extension](module, source, referrer)
|
|
400
|
+
}
|
|
399
401
|
}
|
|
400
|
-
}
|
|
401
402
|
|
|
402
|
-
try {
|
|
403
403
|
return module._transform(isImport, isDynamicImport)
|
|
404
404
|
} catch (err) {
|
|
405
405
|
delete cache[url.href]
|