Well, if you're only using flatten
because you want everything in source/libraries
to go into build
, I would suggest actually using the cwd
(current working directory) option instead. If, on the other hand, you actually have subfolders in source/libraries
then you probably want that src
line to be source/libraries/**/*.js
.
In any case, if you can use cwd
instead it would look like this:
copy: {
main: {
files: [
{
src: ["*.js"],
dest: "build/",
cwd: "source/libraries/"
}
]
}
For the other case, maybe this? (Notice the expand
option set to true
)
copy: {
main: {
files: [
{
src: ["source/libraries/**/*.js"],
dest: "build/",
flatten: true,
expand: true
}
]
}
}