Two gulp 4 tasks run separately but don't work inside gulp.series()How to run Gulp tasks sequentially one after the otherIs it possible to pass a flag to Gulp to have it run tasks in different ways?How to combine gulp-watch and gulp-inject?gulp.series() doesn't run tasksRun Gulp 4 task programmaticallygulp.series doesn't serialize taskRun gulp task in chokidar.on() callbackWorking with asynchronous tasks in Gulp 4Executing tasks in series which creates file dynamically in Gulp 4Gulp 4 Run task one after another

Uniform initialization by tuple

Tesco's Burger Relish Best Before End date number

How can I review my manager, who is fine?

What is the highest level of accuracy in motion control a Victorian society could achieve?

Attach a visible light telescope to the outside of the ISS

Sorting a list according to some pre-specified rules

Need a non-volatile memory IC with near unlimited read/write operations capability

Custom Geolocation Fields not populating in test class

Can the Four Elements monk's Shape the Flowing River elemental discipline create stairs by expending a single ki point?

Function that detects repetitions

What is the meaning of "prairie-dog" in this sentence?

Why did Robert F. Kennedy loathe Lyndon B. Johnson?

How was the website able to tell my credit card was wrong before it processed it?

Examples of fluid (including air) being used to transmit digital data?

Is it ok for parents to kiss and romance with each other while their 2- to 8-year-old child watches?

Was it ever illegal to name a pig "Napoleon" in France?

What factors could lead to bishops establishing monastic armies?

Why no parachutes in the Orion AA2 abort test?

How to have a filled pattern

How do resistors generate different heat if we make the current fixed and changed the voltage and resistance? Notice the flow of charge is constant

What is this burst transmission sequence across the entire band?

What's the difference between a type and a kind?

How to reclaim personal item I've lent to the office without burning bridges?

Who goes first? Person disembarking bus or the bicycle?



Two gulp 4 tasks run separately but don't work inside gulp.series()


How to run Gulp tasks sequentially one after the otherIs it possible to pass a flag to Gulp to have it run tasks in different ways?How to combine gulp-watch and gulp-inject?gulp.series() doesn't run tasksRun Gulp 4 task programmaticallygulp.series doesn't serialize taskRun gulp task in chokidar.on() callbackWorking with asynchronous tasks in Gulp 4Executing tasks in series which creates file dynamically in Gulp 4Gulp 4 Run task one after another






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm experimenting with gulp-4 and got stuck with a problem:



I have files similar to .vue



<template lang="pug">
// ...
</template>

<style lang="scss">
// ...
</style>


and have 2 tasks:



gulp.task('precompile', () => 
return gulp.src(['./src/frontend/views/components/**/*.vue',
'./src/frontend/views/components/**/*.pug',
'./src/frontend/vendor/**/*.pug'])
.pipe(vueFilter)
.pipe(extract('<template lang=\"pug\">','<\/template>'))
.pipe(ext_replace('.pug'))
.pipe(vueFilter.restore)
.pipe(
foreach(
(stream, file) =>
console.log(file.path)
return stream
.pipe(pug(
client: true,
pretty: true,
compileDebug: false,
debug: false,
inlineRuntimeFunctions: false,
name: 'render_' + path.basename(file.path, '.pug')
))
.pipe(replace(/functions([a-zA-z0-9_$]+)/g, (match, name) =>
return name + ': function';
))

)
)
.pipe(concat('templates.js',
newLine: ','
))
.pipe(wrap(' <%= contents %> nr'))
.pipe(defineModule('es6'))
.pipe(ins.prepend("import pug from 'vendor/pug-runtime-es6'nr"))
.pipe(prettier())
.pipe(gulp.dest('./src/frontend/views'));
);


and this:



gulp.task('prepare-sass', () => 
return gulp.src(['./src/frontend/views/components/**/*.vue', './src/frontend/views/components/**/*.scss'])
.pipe(vueFilter)
.pipe(extract('<style lang=\"scss\">','<\/style>'))
.pipe(ext_replace('.scss'))
.pipe(vueFilter.restore)
.pipe(gulp.dest('./src/frontend/views/sass/temp'));
);


May seem complicated but really it's not: second one just extracts styles and then copy them to destination folder, while the first one extracting pug code, precompiles it and then merges in one file "templates.js".



Both tasks work perfectly while running one by one from cli. But when i run them in gulp.series it gives



events.js:174
throw er; // Unhandled 'error' event
^

Error: write after end
at writeAfterEnd (C:Programmingjsmillionairenode_modulesreadable-streamlib_stream_writable.js:288:12)


Well, please don't tell me that all this code and idea itself is hm.. irrelevant (i know that), but the problem indicates that i missunderstand something.. and i can't live with it! ))



Any ideas?



Will appreciate any help or a good piece of advise..










share|improve this question






















  • And besides when executing in series, gulp reports: first one completed, second one completed, whole series completed.. and the error..

    – eonae
    Mar 25 at 21:47

















0















I'm experimenting with gulp-4 and got stuck with a problem:



I have files similar to .vue



<template lang="pug">
// ...
</template>

<style lang="scss">
// ...
</style>


and have 2 tasks:



gulp.task('precompile', () => 
return gulp.src(['./src/frontend/views/components/**/*.vue',
'./src/frontend/views/components/**/*.pug',
'./src/frontend/vendor/**/*.pug'])
.pipe(vueFilter)
.pipe(extract('<template lang=\"pug\">','<\/template>'))
.pipe(ext_replace('.pug'))
.pipe(vueFilter.restore)
.pipe(
foreach(
(stream, file) =>
console.log(file.path)
return stream
.pipe(pug(
client: true,
pretty: true,
compileDebug: false,
debug: false,
inlineRuntimeFunctions: false,
name: 'render_' + path.basename(file.path, '.pug')
))
.pipe(replace(/functions([a-zA-z0-9_$]+)/g, (match, name) =>
return name + ': function';
))

)
)
.pipe(concat('templates.js',
newLine: ','
))
.pipe(wrap(' <%= contents %> nr'))
.pipe(defineModule('es6'))
.pipe(ins.prepend("import pug from 'vendor/pug-runtime-es6'nr"))
.pipe(prettier())
.pipe(gulp.dest('./src/frontend/views'));
);


and this:



gulp.task('prepare-sass', () => 
return gulp.src(['./src/frontend/views/components/**/*.vue', './src/frontend/views/components/**/*.scss'])
.pipe(vueFilter)
.pipe(extract('<style lang=\"scss\">','<\/style>'))
.pipe(ext_replace('.scss'))
.pipe(vueFilter.restore)
.pipe(gulp.dest('./src/frontend/views/sass/temp'));
);


May seem complicated but really it's not: second one just extracts styles and then copy them to destination folder, while the first one extracting pug code, precompiles it and then merges in one file "templates.js".



Both tasks work perfectly while running one by one from cli. But when i run them in gulp.series it gives



events.js:174
throw er; // Unhandled 'error' event
^

Error: write after end
at writeAfterEnd (C:Programmingjsmillionairenode_modulesreadable-streamlib_stream_writable.js:288:12)


Well, please don't tell me that all this code and idea itself is hm.. irrelevant (i know that), but the problem indicates that i missunderstand something.. and i can't live with it! ))



Any ideas?



Will appreciate any help or a good piece of advise..










share|improve this question






















  • And besides when executing in series, gulp reports: first one completed, second one completed, whole series completed.. and the error..

    – eonae
    Mar 25 at 21:47













0












0








0








I'm experimenting with gulp-4 and got stuck with a problem:



I have files similar to .vue



<template lang="pug">
// ...
</template>

<style lang="scss">
// ...
</style>


and have 2 tasks:



gulp.task('precompile', () => 
return gulp.src(['./src/frontend/views/components/**/*.vue',
'./src/frontend/views/components/**/*.pug',
'./src/frontend/vendor/**/*.pug'])
.pipe(vueFilter)
.pipe(extract('<template lang=\"pug\">','<\/template>'))
.pipe(ext_replace('.pug'))
.pipe(vueFilter.restore)
.pipe(
foreach(
(stream, file) =>
console.log(file.path)
return stream
.pipe(pug(
client: true,
pretty: true,
compileDebug: false,
debug: false,
inlineRuntimeFunctions: false,
name: 'render_' + path.basename(file.path, '.pug')
))
.pipe(replace(/functions([a-zA-z0-9_$]+)/g, (match, name) =>
return name + ': function';
))

)
)
.pipe(concat('templates.js',
newLine: ','
))
.pipe(wrap(' <%= contents %> nr'))
.pipe(defineModule('es6'))
.pipe(ins.prepend("import pug from 'vendor/pug-runtime-es6'nr"))
.pipe(prettier())
.pipe(gulp.dest('./src/frontend/views'));
);


and this:



gulp.task('prepare-sass', () => 
return gulp.src(['./src/frontend/views/components/**/*.vue', './src/frontend/views/components/**/*.scss'])
.pipe(vueFilter)
.pipe(extract('<style lang=\"scss\">','<\/style>'))
.pipe(ext_replace('.scss'))
.pipe(vueFilter.restore)
.pipe(gulp.dest('./src/frontend/views/sass/temp'));
);


May seem complicated but really it's not: second one just extracts styles and then copy them to destination folder, while the first one extracting pug code, precompiles it and then merges in one file "templates.js".



Both tasks work perfectly while running one by one from cli. But when i run them in gulp.series it gives



events.js:174
throw er; // Unhandled 'error' event
^

Error: write after end
at writeAfterEnd (C:Programmingjsmillionairenode_modulesreadable-streamlib_stream_writable.js:288:12)


Well, please don't tell me that all this code and idea itself is hm.. irrelevant (i know that), but the problem indicates that i missunderstand something.. and i can't live with it! ))



Any ideas?



Will appreciate any help or a good piece of advise..










share|improve this question














I'm experimenting with gulp-4 and got stuck with a problem:



I have files similar to .vue



<template lang="pug">
// ...
</template>

<style lang="scss">
// ...
</style>


and have 2 tasks:



gulp.task('precompile', () => 
return gulp.src(['./src/frontend/views/components/**/*.vue',
'./src/frontend/views/components/**/*.pug',
'./src/frontend/vendor/**/*.pug'])
.pipe(vueFilter)
.pipe(extract('<template lang=\"pug\">','<\/template>'))
.pipe(ext_replace('.pug'))
.pipe(vueFilter.restore)
.pipe(
foreach(
(stream, file) =>
console.log(file.path)
return stream
.pipe(pug(
client: true,
pretty: true,
compileDebug: false,
debug: false,
inlineRuntimeFunctions: false,
name: 'render_' + path.basename(file.path, '.pug')
))
.pipe(replace(/functions([a-zA-z0-9_$]+)/g, (match, name) =>
return name + ': function';
))

)
)
.pipe(concat('templates.js',
newLine: ','
))
.pipe(wrap(' <%= contents %> nr'))
.pipe(defineModule('es6'))
.pipe(ins.prepend("import pug from 'vendor/pug-runtime-es6'nr"))
.pipe(prettier())
.pipe(gulp.dest('./src/frontend/views'));
);


and this:



gulp.task('prepare-sass', () => 
return gulp.src(['./src/frontend/views/components/**/*.vue', './src/frontend/views/components/**/*.scss'])
.pipe(vueFilter)
.pipe(extract('<style lang=\"scss\">','<\/style>'))
.pipe(ext_replace('.scss'))
.pipe(vueFilter.restore)
.pipe(gulp.dest('./src/frontend/views/sass/temp'));
);


May seem complicated but really it's not: second one just extracts styles and then copy them to destination folder, while the first one extracting pug code, precompiles it and then merges in one file "templates.js".



Both tasks work perfectly while running one by one from cli. But when i run them in gulp.series it gives



events.js:174
throw er; // Unhandled 'error' event
^

Error: write after end
at writeAfterEnd (C:Programmingjsmillionairenode_modulesreadable-streamlib_stream_writable.js:288:12)


Well, please don't tell me that all this code and idea itself is hm.. irrelevant (i know that), but the problem indicates that i missunderstand something.. and i can't live with it! ))



Any ideas?



Will appreciate any help or a good piece of advise..







node.js gulp-4






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 21:27









eonaeeonae

1




1












  • And besides when executing in series, gulp reports: first one completed, second one completed, whole series completed.. and the error..

    – eonae
    Mar 25 at 21:47

















  • And besides when executing in series, gulp reports: first one completed, second one completed, whole series completed.. and the error..

    – eonae
    Mar 25 at 21:47
















And besides when executing in series, gulp reports: first one completed, second one completed, whole series completed.. and the error..

– eonae
Mar 25 at 21:47





And besides when executing in series, gulp reports: first one completed, second one completed, whole series completed.. and the error..

– eonae
Mar 25 at 21:47












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55346655%2ftwo-gulp-4-tasks-run-separately-but-dont-work-inside-gulp-series%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55346655%2ftwo-gulp-4-tasks-run-separately-but-dont-work-inside-gulp-series%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript