Add subfolder to path.dist in Sage 8.5

Hey guys, I would like to add a subfolder to the build directory.

dist/project/ instead of dist/

Build asset folder structure would look like this:


I see that path.dist defaults to dist/ but don’t know where to update this path to include a new subfolder in the path.

Thanks for your help!

Can I ask why this is something you need? It’s probably in the gulp configuration.

Little bit of digging, if you check the gulpfile it shows you the object where the directory is being stored (I’m on my phone so no line counts for you). I haven’t ever tried, but manually changing the path should work. Just add this is after where the path variable is declared;

path.dist = your/custom/directory/

It seems to be set as default by asset-builder, check out the docs there for more info (though I personally find the docs pretty confusing). This seems to be the relevant part to you.

1 Like

Oh great, the asset-builder paths was what I needed to know.

I updated assets/manifest.json with the same as his example code and added a subdirectory:

  "dependencies": {
    "app.js": {
      "files": ["scripts/main.js"],
      "main": true
  "paths": {
    "source": "assets/",
    "dist": "dist/project/"

That worked. Thank you!

This is a very small use case where I’ll be porting it to another theme where I’m I want a specific structure and this saves me a little hassle.

1 Like

Glad to help- for future reference if you could post your code snippet and where you applied it, that would be super :slight_smile: