# Correct loading of nested pack file

**URL:** <https://phaser.discourse.group/t/correct-loading-of-nested-pack-file/10519>\
**Category:** Phaser 3\
**Created:** [October 26, 2021, 2:40pm UTC](https://phaser.discourse.group/t/correct-loading-of-nested-pack-file/10519 "2021-10-26T14:40:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvasuta](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/dvasuta/32/5297_2.png) [@dvasuta](https://phaser.discourse.group/u/dvasuta)\
**Post date:** [October 26, 2021, 2:40pm UTC](https://phaser.discourse.group/t/correct-loading-of-nested-pack-file/10519/1 "2021-10-26T14:40:56Z")

</div>

Hi everyone.  
I can’t find real world examples for loading nested pack files.  
Basic example

```javascript
{
  "desktop": {
    "path": "./src/assets/images",
    "files": [{
      "type": "image",
      "key": "gamescene_background",
      "url": "maingame_screen.png"
    }]
  },
"meta": {
  "generated": "1401380327373",
  "app": "Phaser 3 Asset Packer",
  "url": "https://phaser.io",
  "version": "1.0",
  "copyright": "Photon Storm Ltd. 2018"
}
}

```

Then I need to add one more level

```javascript
{
  "desktop": {
    "regular": {
      "path": "./src/assets/images",
      "files": [{
        "type": "image",
        "key": "gamescene_background",
        "url": "maingame_screen.png"
      }]
    },
    "vip": {
      "path": "./src/assets/images",
      "files": [{
        "type": "image",
        "key": "gamescene_background",
        "url": "maingame_screen.png"
      }]
    }
  },
  "meta": {
    "generated": "1401380327373",
    "app": "Phaser 3 Asset Packer",
    "url": "https://phaser.io",
    "version": "1.0",
    "copyright": "Photon Storm Ltd. 2018"
  }
}
...
        this.load.pack('pack', './src/configs/pack.json', 'desktop.regular');

```

And it doesn’t work. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [October 26, 2021, 3:15pm UTC](https://phaser.discourse.group/t/correct-loading-of-nested-pack-file/10519/2 "2021-10-26T15:15:45Z")

</div>

You can’t nest sections.

You could make separate pack files, or you could name sections like `desktop.regular`.

---

<div class="post-metadata">

**Author:** ![dvasuta](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/dvasuta/32/5297_2.png) [@dvasuta](https://phaser.discourse.group/u/dvasuta)\
**Post date:** [October 26, 2021, 8:52pm UTC](https://phaser.discourse.group/t/correct-loading-of-nested-pack-file/10519/3 "2021-10-26T20:52:15Z")

</div>

@samme Weird. I thought that this example just means such use of this functionality. This is clearly not the case. But then what exactly is shown in this example? How can this be used?

 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/2/2b7622e9cb7461659d56d96969285c765aa66522.png)  
[pack - Phaser 3 API Documentation (beta)](https://newdocs.phaser.io/docs/3.54.0/focus/Phaser.Loader.LoaderPlugin-pack)

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [October 26, 2021, 10:39pm UTC](https://phaser.discourse.group/t/correct-loading-of-nested-pack-file/10519/4 "2021-10-26T22:39:11Z")

</div>

I guess it’s a mistake. 🙂
