Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Identical blocks being processed multiple times #289
I have a lot of html files that are generated by a static site generator. Since I am using layouts in the SSG, the files have duplicate and blocks that are the same. I have found that useminPrepare creates a concat task for all of the blocks even though they are all identical. concat is then processing the same blocks multiple times. With a large site, this becomes especially slow when duplicate uglify tasks are also created (I was able to get around this by creating a custom flow). Plus, it is also error prone since the last duplicate concat task wins (which may be different).
It would be really nice to have the option to "ignoreDuplicateBlocks" so they won't be processed multiple times. Also if one of the duplicates is composed of different js or css files, an error should be raised and the build should fail.
If someone can give me an idea of the best way to fix this, I would be glad to work on it.
Would create identical config tasks something like:
You did give me a good idea though. I ran useminPrepare against my template files before they were assembled. This way only the unique blocks were added and it is very efficient.
Thanks for the help!
I think duplicate blocks caused by multiple html files should be eliminated by programs, not human hands -- that's what a "scaffolding tool" is created for!
...And I made a pull request for this.