@player-ui/reference-assets-plugin 0.14.0-next.1 → 0.14.0-next.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.
@@ -8410,7 +8410,7 @@ var ReferenceAssetsPlugin = function() {
8410
8410
  var createAsyncTransform = function(options) {
8411
8411
  var transformAssetType = options.transformAssetType, wrapperAssetType = options.wrapperAssetType, getNestedAsset = options.getNestedAsset, _options_getAsyncNodeId = options.getAsyncNodeId, getAsyncNodeId = _options_getAsyncNodeId === void 0 ? defaultGetNodeId : _options_getAsyncNodeId, _options_path = options.path, path = _options_path === void 0 ? [
8412
8412
  "values"
8413
- ] : _options_path, tmp = options.flatten, flatten2 = tmp === void 0 ? true : tmp;
8413
+ ] : _options_path, tmp = options.flatten, flatten2 = tmp === void 0 ? true : tmp, _options_asyncNodePosition = options.asyncNodePosition, asyncNodePosition = _options_asyncNodePosition === void 0 ? "append" : _options_asyncNodePosition;
8414
8414
  var replaceNode = function(node) {
8415
8415
  var unwrapped = unwrapAsset(node);
8416
8416
  if (unwrapped.type !== NodeType.Asset || unwrapped.value.type !== transformAssetType) {
@@ -8424,26 +8424,33 @@ var ReferenceAssetsPlugin = function() {
8424
8424
  return traverseAndReplace(node, replaceNode);
8425
8425
  };
8426
8426
  var asyncTransform2 = function(node) {
8427
+ var _Builder;
8427
8428
  var id = getAsyncNodeId(node);
8428
8429
  var asset = getNestedAsset === null || getNestedAsset === void 0 ? void 0 : getNestedAsset(node);
8429
8430
  var replaceFunction = flatten2 ? replacer : void 0;
8430
8431
  var asyncNode = Builder.asyncNode(id, flatten2, replaceFunction);
8431
- var multiNode;
8432
+ var values = [
8433
+ asyncNode
8434
+ ];
8432
8435
  if (asset) {
8436
+ var otherValues = [];
8433
8437
  if (requiresAssetWrapper(asset)) {
8434
- var assetWrappedNode = Builder.assetWrapper(asset);
8435
- multiNode = Builder.multiNode(assetWrappedNode, asyncNode);
8438
+ otherValues.push(Builder.assetWrapper(asset));
8436
8439
  } else if (asset.type === NodeType.MultiNode) {
8437
- var _Builder;
8438
- multiNode = (_Builder = Builder).multiNode.apply(_Builder, _to_consumable_array(asset.values).concat([
8439
- asyncNode
8440
- ]));
8440
+ var _otherValues;
8441
+ (_otherValues = otherValues).push.apply(_otherValues, _to_consumable_array(asset.values));
8441
8442
  } else {
8442
- multiNode = Builder.multiNode(asset, asyncNode);
8443
+ otherValues.push(asset);
8444
+ }
8445
+ if (asyncNodePosition === "append") {
8446
+ var _values;
8447
+ (_values = values).unshift.apply(_values, _to_consumable_array(otherValues));
8448
+ } else {
8449
+ var _values1;
8450
+ (_values1 = values).push.apply(_values1, _to_consumable_array(otherValues));
8443
8451
  }
8444
- } else {
8445
- multiNode = Builder.multiNode(asyncNode);
8446
8452
  }
8453
+ var multiNode = (_Builder = Builder).multiNode.apply(_Builder, _to_consumable_array(values));
8447
8454
  var wrapperAsset = Builder.asset({
8448
8455
  id: wrapperAssetType + "-" + id,
8449
8456
  type: wrapperAssetType