First time using this task and what I'm trying to achieve is the following:
copy all directories/files from src/js/bower_components/*
to build/assets/js/vendor/
I've tried using cwd
property but it doesn't work at all when I use it.. I've set it to: src/js/bower_components/
From src
.
├── Gruntfile
└── src
└── js
└── bower_components
└── jquery
I currently get:
.
├── Gruntfile
└── build
└── assets
└── js
└── vendor
src
└── js
└── bower_components
└── jquery
What I'd like
.
├── Gruntfile
└── build
└── assets
└── js
└── vendor
└──jquery
Here's my current grunt task
copy: {
main: {
src: 'src/js/bower_components/*',
dest: 'build/assets/js/vendor/',
expand: true,
}
},
Thanks for any help
I've set up an example project with tree like this:
Using the below Gruntfile:
This gave me this structure:
When I had changed
cwd
so that the Gruntfile read:I got this dir structure:
So it seems like
cwd
does what you need. Maybe you leftsrc
atsrc/js/bower_components/*
when settingcwd
tosrc/js/bower_components
? In that case,src
should read something like**/*.js
, but depending on what you really need.