I'm adding Bower to project which is using Gulp already. My folder structure is like:
|- bower_components
| |- dependency1
| | |- dist
| | |- lib1.js
| | |- lib1.min.js
| |
| |- dependency2
| |- core
| |- sub
| | |- extra.js
| |
| |- lib2.js
|
|- target
|- js
I have already managed to copy all 3rd party libreries to target/js using main-bower-files and bower-normalize. But it's flatten (and I didn't set bower-normalize option flatten
to true!), so it's looks like:
target
|- js
|- lib1.js
|- extra.js
|- lib2.js
Files lib1.js
, extra.js
and lib2.js
are marked as main
in bower.json config file.
What I would like to achieve is to have files structure like:
target
|- js
|- dependency1
| |- lib1.js
|
|- dependency2
|- sub
| |- extra.js
|
|- lib2.js
I will be really greatful for help!
Your source directory with bower components:
Using gulp-flatten -
will create this structure (from above tree directory):
includeParents: [1, 1]
If passes as array of two numbers, both parents from top and bottom will be kept in resulting path of a file.includeParents: 1
If passed in as positive number, it will include the number of top-level parents in the output.includeParents: -1
If passed in as negative number, it will include the number of bottom-level parents in the output.