Copying "other" assets into dist
joelstransky opened this issue · 1 comments
joelstransky commented
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.
joelstransky commented
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'));
}
}
};