bare-module-traverse 2.4.2 → 2.4.3

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 +8 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -332,6 +332,8 @@ exports.preresolved = function* (url, source, resolutions, artifacts, visited, o
332
332
 
333
333
  if (typeof imports !== 'object' || imports === null) return false
334
334
 
335
+ const type = moduleType(url, {}, null, opts)
336
+
335
337
  for (const [specifier, entry] of Object.entries(imports)) {
336
338
  const stack = [{ entry, asset: false }]
337
339
 
@@ -352,7 +354,8 @@ exports.preresolved = function* (url, source, resolutions, artifacts, visited, o
352
354
  yield {
353
355
  children: exports.module(url, null, {}, artifacts, visited, {
354
356
  ...opts,
355
- asset: true
357
+ asset: true,
358
+ referrerType: type
356
359
  }),
357
360
  deferred: true
358
361
  }
@@ -362,7 +365,10 @@ exports.preresolved = function* (url, source, resolutions, artifacts, visited, o
362
365
  url.protocol !== deferredProtocol
363
366
  ) {
364
367
  yield {
365
- children: exports.module(url, null, {}, artifacts, visited, opts),
368
+ children: exports.module(url, null, {}, artifacts, visited, {
369
+ ...opts,
370
+ referrerType: type
371
+ }),
366
372
  deferred: false
367
373
  }
368
374
  }
@@ -374,8 +380,6 @@ exports.preresolved = function* (url, source, resolutions, artifacts, visited, o
374
380
  }
375
381
  }
376
382
 
377
- const type = moduleType(url, {}, null, opts)
378
-
379
383
  const lexer = { imports: [], exports: [] }
380
384
 
381
385
  if (type === constants.SCRIPT || type === constants.MODULE) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module-traverse",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Low-level module graph traversal for Bare",
5
5
  "exports": {
6
6
  ".": {