austinpray/asset-builder

Copying "other" assets into dist

joelstransky opened this issue · 1 comments

How might I leverage manifest.json to copy files that aren't supported directly into my dist folder?
I'm writing a WordPress theme using Sage 8.4.2 which is going to use jplayer. jplayer requires its .js AND a .swf file. How might I modify manifest.json, gulpfile.js or both to make sure the .swf is carried over each time?
Thanks.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39699208-copying-other-assets-into-dist?utm_campaign=plugin&utm_content=tracker%2F8853550&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F8853550&utm_medium=issues&utm_source=github).

Kind of a solution you might think about supporting.
in manifest.json

{
  "dependencies": {
    "jplayer.js": {
      "bower": [
        "jPlayer"
      ],
      "libAssets": [
        "./bower_components/jPlayer/dist/jplayer/jquery.jplayer.swf"
      ]
    }
  }
}

in gulpfile.js

// copy any file listed in manifest.dependencies.dependency.libAssets[] to dist/scripts
var libAssets = function() {
  for (var el in manifest.dependencies) {
    if (manifest.dependencies[el].libAssets) {
      gulp.src(manifest.dependencies[el].libAssets)
      .pipe(gulp.dest(path.dist + 'scripts'));
    }
  }
};