actum / gulp-dev-stack

Actum dev stack based on gulp
MIT License
11 stars 7 forks source link

SVG: Proper bundling #104

Closed kettanaito closed 7 years ago

kettanaito commented 7 years ago

Concept: each folder under src/gfx/svg should represent a sprite where each file in a folder represents an icon belonging to that sprite.

Issue: when you have 2+ folders it does not bundle correctly.

Reason: in globing all the files go in one stream, which leads to folder analysis being wrong. To cut the long story short, we cannot pass icons from all folders to the glob.

Solution: analyze the folders, create a sprite Object, which will contain sprite names and glob paths to the SVG files within the folders. Then loop through the globs and run already existing gulp task through each glob.

The suggested solution was implemented on Conrad. I have tested it in terms of performance and did not find any significant difference between current state and the suggested one. If I am not mistaken, Gulp pipes will run async, unless chained. This leads to two separate gulp pipelines running simultaneously, not affecting performance. Please, correct me if I am wrong assuming that.

The solution will be refactored and a new pull request will be created regarding this issue.

janpanschab commented 7 years ago

close #109