Closed Tanato closed 8 years ago
After dig a little better why is the motive for this "patch" in filename base to use the first one for every file, I saw the issue #103 and seems to me that the fix applied worked fine but only if you have a single base path.
I'll try to recreate the issue in my environment so I can fix both errors properly (seems to me that the issue is in relPath function).
I create an environment with the structure bellow to simulate the issue #103 and my pull-request doesn't break the previous fix
app/
├ common/
| ├ common-app.js
| ├ component/
| | ├ component.js
| | ├ exceptions/
| | | └ exception.js
├ core/
| ├ core-app.js
| ├ features/
| | ├ animals/
| | | └ animals-ctrl.js
| | ├ donate/
| | | └ donate-ctrl.js
gulp.task('teste', function () {
gulp.src([
'app/common/**/*.js', // first source dir
'app/core/**/*.js' // second source dir
])
.pipe(rev())
.pipe(revReplace())
.pipe(gulp.dest('teste/'))
.pipe(rev.manifest('version.json', {
merge: true
}))
.pipe(gulp.dest('teste/'));
});
{
"common-app.js": "common-app-986b060995.js",
"components/components.js": "components/components-1ce0abfcd5.js",
"components/exceptions/exceptions.js": "components/exceptions/exceptions-c5ce7827eb.js",
"core-app.js": "core-app-c8a28dd6f3.js",
"features/animals/animals-ctrl.js": "features/animals/animals-ctrl-9ac224798d.js",
"features/donate/donate-ctrl.js": "features/donate/donate-ctrl-1503f2123c.js",
}
:+1:
+1. this was driving me nuts.
Like in issue #47, I have a problem when using streams with differents paths but the fix doesn't solve my problem
I have to copy my files from the structure below to the next one
And for my needs, I expect the structure in the manifest file to be something like this:
All those files have the same
build/
folder in the destination, so I map the base in src to{ base: './'}
as you can see in my code below:I know that I could use multiple streams for achieve this, but in my case doesn't make sense since I have the same pipes to work in those files.
To fix this problem, I just had to change the manifest base path to be the base of each file, and not the first one for all files.
I couldn't understand why you use a single path as base for all, but seems to me that this change doesn't affect how the manifest works and not the performance as well.
Please let me know if I misunderstood something or if there's any reason for this pull request couldn't be