Closed ismay closed 10 years ago
Ok, so since I was building to a different folder than build
I didn't notice that that's where it was putting the files. Figured out that passing it a different destination like so:
// copy other files to the build folder
build.files(tree, {destination: 'my-build-folder'})
.use('files', build.plugins.copy())
.use('fonts', build.plugins.copy())
.use('images', build.plugins.copy())
.end(); // callback optional
does the job. Hope that this helps should anyone encounter the same problem.
Hi,
I know component is no longer maintained. But just wanted to understand the copy process. Is it true that it doesn't copy directories and copies only files present.
{
"name": "boot",
"images": [
"logo.jpg",
"homepage/adbanner.jpg"
]
}
here adbanner.jpg won't be copied right?
Not sure, but here is the source code: https://github.com/componentjs/builder2.js/blob/master/lib/plugins/copy.js
It uses the cp module https://www.npmjs.com/package/cp
The example from the documentation does not copy files to the destination folder when the
copy()
plugin is used instead of thesymlink()
plugin.It seems like there's something missing from the example (I assume that the actual copying still has to be done, with a callback maybe?), but I'm not able to figure it out from the docs alone, as I couldn't find any documentation on what the copy plugin actually does. My full code is:
and the component I'm trying to compile is:
Maybe the docs could be expanded with an example for
.copy()
, or elaborate a little on what the.copy()
plugin actually does?