Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Gulp 4 issue syncing when mapping multiple times

$
0
0

Currently having an issue when trying to sync up a function when pulling all the data from a config file. Is it wrong to have a map function within a map function? I have seen some use cases online but have unable to replicate it.

Here is ticket that is similar, Gulp 4 - How to generate dynamic tasks based on two arrays

gulp task

function temp_init(task_done) {
//config
const getConfig = config.map((config) => {
  return (config_done) => {

    // units
    const units = config.Units.map((unit) => {
        return (units_done) => {

            // size
            const sizes = unit.Sizes.map((size) => {
                return (sizes_done) => {

                    src(`${dir.banner_templates}/${unit.Template}/${"default"}/**/*`)
                    .pipe(plumber())
                    //gulp tasl

                    sizes_done();
                }
            });

            return parallel(...sizes, (series_done) => {
                series_done();
                units_done();
            })();

        }
    });

    return parallel(...units, (series_done) => {
        series_done();
        config_done();
    })();
    //

  }
});

return parallel(...getConfig, (series_done) => {
    series_done();
    task_done();
})();
}

config.js

module.exports = [{

Agency: "Agency-Name",
Client: "Client-Name_Config",               
Campaign: "Campaign-Name_Config",           
Ad_Platforms: "iab",                        
Server_Location: "",
Units:[
    {
        Version_Name: "Version1_Name",      
        Template: "standard",               
        Click_Tags: 3,                      
        Naming_Convention:{
            Name_Before_AdSize: "Q119_038", 
            Name_After_AdSize: ""           
        },      
        Create_BackupImages: "false",
        Duplicate_Master: "false",  
        Sizes: [
            { width:300,    height:250, fileWeight: 150},
            { width:160,    height:600, fileWeight: 150},
            { width:300,    height:600, fileWeight: 150},
            { width:320,    height:50,  fileWeight: 150},
            { width:728,    height:90,  fileWeight: 150},
            { width:970,    height:66,  fileWeight: 150},
            { width:970,    height:250, fileWeight: 150},
            { width:1280,   height:100, fileWeight: 150}
        ]
    }       
]}]

Error below, anonymous playing after the default is running

[16:55:43] Starting 'default'...
[16:55:43] Starting 'temp_init'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Finished '<anonymous>' after 1.16 ms
[16:55:43] Finished 'temp_init' after 2.45 ms
[16:55:43] Finished 'default' after 4.14 ms
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Starting '<anonymous>'...
[16:55:43] Finished '<anonymous>' after 8.35 ms
[16:55:43] Finished '<anonymous>' after 9.49 ms
[16:55:43] Finished '<anonymous>' after 18 ms
[16:55:43] Finished '<anonymous>' after 20 ms
[16:55:43] Finished '<anonymous>' after 22 ms
[16:55:43] Finished '<anonymous>' after 23 ms
[16:55:43] Finished '<anonymous>' after 29 ms
[16:55:43] Finished '<anonymous>' after 30 ms
[16:55:43] Finished '<anonymous>' after 32 ms
[16:55:43] Finished '<anonymous>' after 33 ms
[16:55:43] Finished '<anonymous>' after 33 ms
[16:55:43] Finished '<anonymous>' after 36 ms

Any thoughts on how I can have all the anonymous calls happen within the default task?


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>