Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying "other" assets into dist #68

Open
joelstransky opened this issue Dec 1, 2016 · 1 comment
Open

Copying "other" assets into dist #68

joelstransky opened this issue Dec 1, 2016 · 1 comment

Comments

@joelstransky
Copy link

joelstransky commented Dec 1, 2016

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).
@joelstransky
Copy link
Author

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'));
    }
  }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant