What is the advantage of using asset-builder rather then enqueueing scripts as usual?
I’m initialising a new project and I’ll be using bootstrap.
I’m about to pull in the bootstrap js. I figured I should try and do things the Sage way.
I can see that there is a file called ‘manifest.json’ in ‘assets/scripts’. Further rabbitholing leads me to the documentation for asset-builder, where I discover that the asset-builder module “assembles and orchestrates your dependencies so you can run them through your asset pipeline”.
That sounds like something I should be doing.
After all, I am using an asset pipeline.
So, I’m guessing that I should make bootstrap.js a dependency, and declare it as such in manifest.json.
That’s all well and good.
But I’m still not sure why I’m doing this.
Looking back at the description of asset-builder, I see this: “Feed it a manifest file and it will give you globs”.
At this point I’m left scratching my head.
Can someone give me a description of what asset-builder does for the developer? And why I should declare scripts as deps rather then simply enqueueing them?