Closed austerus closed 9 years ago
+1
+1
:+1:
++1;
Because you are merging the resulting manifest file and you have concurrent(parallel) tasks running at once, in some situations this will result in two streams trying to write the file at once.
If you instead make these separate task run in series, one after the other completes, that should solve your problem.
Another possible solution is to remove the merge feature, give each manifest its own name, and add a new gulp task that watches the resulting files for changes, src's them, merges them, then outputs it to the desired filename.
Still have a similar issue with concurrent rev calls. Would it be possible to lock the rev file while working with it and let the other tasks wait for unlock? merge doesn't for me work, the tasks keep overwriting the manifest file mutually.
No, locking is not the right answer. Do what @BerkeleyTrue said and you should be good :)
Here is an example of how I'm accomplishing this. https://github.com/FreeCodeCamp/FreeCodeCamp/blob/staging/gulpfile.js#L274
Apologies for the messy file. I went with option two because I had so many different manifest files.
Anyone out there know of packages that can build manifest files in the same fashion using the command line? At the moment we are using gulp to build these in production, but I would like to remove the need for gulp on our production servers.
Here's my approach to solving this: https://gist.github.com/ghidinelli/e9806063ddbfa74bed7e
Generate the rev-manifest.json file manually from the files in your dist folder and make sure that runs after your parallelized styles/scripts tasks by using the run-sequence plugin.
@austerus Closing this issue. If you still need any assistance then reopen it please. Thanks.
Hello,
I am trying to use gulp-rev to have a cache busting system alongside a Symfony2 application, but when I try to use it my gulp file, it always results in some very random contents of the manifest file.
How it looks like in gulp:
Task where this is called:
Resulting manifest file:
The manifest contents changes every time the task runs, sometimes it results in one correct file but most of the times it has this partial content.
This happens regardless whether I use buffer or not.
Is there something I'm doing wrong or is there an issue?
Thanks & regards