bare-module-traverse 1.2.4 → 1.2.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.
- package/README.md +1 -1
- package/index.js +1 -3
- package/lib/resolve/bare.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ for await (const dependency of traverse(new URL('file:///directory/file.js'), re
|
|
|
48
48
|
|
|
49
49
|
#### `const dependencies = traverse(url[, options], readModule[, listPrefix])`
|
|
50
50
|
|
|
51
|
-
Traverse the module graph rooted at `url`, which must be a WHATWG `URL` instance. `readModule` is called with a `URL` instance for every module to be read and must either return the module source, if it exists, or `null`. `listPrefix` is called with a `URL` instance of every prefix to be listed and must
|
|
51
|
+
Traverse the module graph rooted at `url`, which must be a WHATWG `URL` instance. `readModule` is called with a `URL` instance for every module to be read and must either return the module source, if it exists, or `null`. `listPrefix` is called with a `URL` instance of every prefix to be listed and must yield `URL` instances that have the specified `URL` as a prefix. If not provided, prefixes won't be traversed. If `readModule` returns a promise or `listPrefix` returns a promise generator, synchronous iteration is not supported.
|
|
52
52
|
|
|
53
53
|
Options include:
|
|
54
54
|
|
package/index.js
CHANGED
package/lib/resolve/bare.js
CHANGED
|
@@ -5,6 +5,7 @@ module.exports = function (entry, parentURL, opts = {}) {
|
|
|
5
5
|
const runtime = require('#runtime')
|
|
6
6
|
|
|
7
7
|
const {
|
|
8
|
+
linked = false,
|
|
8
9
|
platform = runtime.platform,
|
|
9
10
|
arch = runtime.arch,
|
|
10
11
|
simulator = false,
|
|
@@ -17,10 +18,10 @@ module.exports = function (entry, parentURL, opts = {}) {
|
|
|
17
18
|
if (simulator) conditions = [...conditions, 'simulator']
|
|
18
19
|
|
|
19
20
|
if (entry.type & lex.constants.ADDON) {
|
|
20
|
-
extensions = ['.bare', '.node']
|
|
21
|
+
extensions = linked ? [] : ['.bare', '.node']
|
|
21
22
|
conditions = ['addon', ...conditions]
|
|
22
23
|
|
|
23
|
-
return resolve.addon(entry.specifier || '.', parentURL, { extensions, conditions, host, ...opts })
|
|
24
|
+
return resolve.addon(entry.specifier || '.', parentURL, { extensions, conditions, host, linked, ...opts })
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
if (entry.type & lex.constants.ASSET) {
|