-
Notifications
You must be signed in to change notification settings - Fork 339
Identical blocks being processed multiple times #289
Comments
look at generator-jekyllrb and see how it uses usemin. I have a feeling you are doing the usemin task at the wrong point in the site creation |
That project does it exactly the same way I'm doing it and in the same order. The only thing different is that it is scanning only the root index.html file. My project is large. Each page does use the same layout, but each page is also able to define css and javascript blocks that get inserted into the main layout header. In this case each page will have the same core javascript files and can have different css and javascript blocks as well. If I just scan the index.html, it won't find these extra blocks. 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 also met same problem ,Each page have own conca js file and concat gblobal js file. |
|
Seems like 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. |
@eddiemonge would be good if you could review 324. |
This should resolve yeoman#289. This also detects a bad configuration where multiple blocks attempt to write to the same destination with different sources.
This should resolve yeoman#289. This also detects a bad configuration where multiple blocks attempt to write to the same destination with different sources.
see #382 |
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.
Example:
file1.hml
file2.html
Would create identical config tasks something like:
The text was updated successfully, but these errors were encountered: