Copy folder structure from src / to dist / using grunt-contrib-copy
I have a folder structure that looks like this:
I want to copy folder img/
from src/
to folder dist/
.
I am using the following grunt command using grunt-contrib-copy :
copy:{
main : {
files : [
{
flatten : true,
expand: true,
src: ['src/img/*'],
dest: 'dist/img'
}
]
}
}
But my folder structure ends like this. Missing image in icons folder:
Basically, I want to make a linux command (when I got to the root of my project):
cp -r src/img dist/img
How can i do this?
+3
source to share
2 answers
Set flatten to false flatten : false
and change src to ['src/img/**']
to include subdirectories (source: https://github.com/gruntjs/grunt-contrib-copy )
copy:{
main : {
files : [
{
flatten : false,
expand: true,
src: ['src/img/**'],
dest: 'dist/img'
}
]
}
}
0
source to share