webextensions/copy-files-from-to

Request: Ability to consider only the last part of "from" when using glob

zeniale opened this issue · 2 comments

Actually if i configure the .json file like this:

{
	"copyFiles": [
		{
			"from": "node_modules/@fortawesome/fontawesome-free/webfonts/**/*",
			"to": "wwwroot/content/webfonts/"
		}
	]
}

I obtain a folder strucure like this:
image

It is possible to ignore the part before glob?
I like to have a folder structure like this:
image

Thanks

@zeniale
Try out this feature with copy-files-from-to@1.3.0 now :-)

Please use the "toFlat" parameter:

// Copy the files matching the "glob" pattern
// (all of the matching files directly go into the
// "to" directory) since "toFlat" is set to "true"
{
    "from": "assets/**/*.jpg",
    "to": "public/copy-all-jpg-files-to-this-directory/",
    "toFlat": true
}

@webextensions
Wonderful, it's work fine.
Thank you!!!