+2 votes
ago by
Use this task: https://github.com/gruntjs/grunt-contrib-copy

Pulled bootstrap and want to copy these folders to yourself:
/bower_components/bootstrap/dist
/bower_components/bootstrap/fonts
/bower_components/bootstrap/js
/bower_components/bootstrap/less
Wrote here such task:
{expand: true, flatten: true, src: [
'bower_components/bootstrap/dist/*',
'bower_components/bootstrap/fonts/*',
'bower_components/bootstrap/js/*',
'bower_components/bootstrap/less/*'
], dest: 'src/vendor/bootstrap/', filter: 'isFile'},
There was a problem, all the files from these folders flying in src/vendor/bootstrap/forming dump. If flatten to false, then it will fly like this:
src/vendor/bootstrap/bower_components/bootstrap/fonts
src/vendor/bootstrap/bower_components/bootstrap/js
src/vendor/bootstrap/bower_components/bootstrap/less
Ie unnecessary nesting: bower_components/bootstrap/
In the course of carelessness or not knowing English. language, can not find in docks what the problem is. How to copy folders from one directory to another without nesting ?

2 Answers

0 votes
ago by
 
Best answer
{
expand: true,
cwd: 'bower_components/bootstrap',
src: '**/*',
dest: 'src/vendor/bootstrap/',
filter: 'isFile'
},
In General, all the salt in cwd
0 votes
ago by
Why to copy them? Specify the path to bower_components and work. In any case, using bower connecting library in which to make changes is not recommended.
ago by
Well, what do you mean not recommended?
If the plugin is not enough or events funkcionala for example, you need to add custom event? In the same Bootstrap to reassign the colors, or to exclude from build some unnecessary while less. No wonder the library consists of directories dist (where are the collected versions of the files .css .min.js) and src (where all in human form for the work of other developments js, less). How often do you come across the same way. jQuery plugins are 100% functional fit your objectives?
...