logo
down
shadow

Gulp 4 watch gulp.series only run one time


Gulp 4 watch gulp.series only run one time

By : DIPS
Date : October 21 2020, 08:10 AM
Hope this helps I made a complete rewrite that can be found here: https://github.com/jenstornell/gulpfile-style-script.
You can also see it here. Hope it helps someone.
code :
let gulp = require("gulp");
let sass = require("gulp-sass");
let autoprefixer = require("gulp-autoprefixer");
let concat = require("gulp-concat");
let uglify = require('gulp-uglify-es').default;
let csso = require('gulp-csso');
let rename = require('gulp-rename');

var css = {
  src: 'assets/css/src/**/*.scss',
  dest: 'assets/css/dist',
  filename: 'style.scss'
};

var js = {
  src: 'assets/js/src/**/*.js',
  dest: 'assets/js/dist',
  filename: 'script.js'
};

function style() {
  return (
    gulp
      .src(css.src)
      .pipe(concat(css.filename))
      .pipe(sass())
      .on("error", sass.logError)
      .pipe(autoprefixer())
      .pipe(gulp.dest(css.dest))
      .pipe(csso())
      .pipe(rename({extname: '.min.css'}))
      .pipe(gulp.dest(css.dest))
  );
}

function script() {
  return (
    gulp
      .src(js.src)
      .pipe(concat(js.filename))
      .pipe(gulp.dest(js.dest))
      .pipe(uglify())
      .pipe(rename({extname: '.min.js'}))
      .pipe(gulp.dest(js.dest))
  );
}

function watch(){
  gulp.watch(css.src, style);
  gulp.watch(js.src, script);
}

exports.css = style;
exports.js = script;
exports.default = watch;


Share : facebook icon twitter icon
Gulp to watch when node app.listen() is invoked or to port (livereload, nodejs and gulp)

Gulp to watch when node app.listen() is invoked or to port (livereload, nodejs and gulp)


By : user3370407
Date : March 29 2020, 07:55 AM
I hope this helps you . I am trying to get gulp-livereload to work with my nodejs server. I am using gulp-nodemon to restart the server after changes to the files, this works. I am having trouble invoking livereload.reload() at the correct time. , Use readable event to monitor stdout of child process.
example:
code :
nodemon({script: 'app.js',
         nodeArgs: ['--harmony'],
         stdout: false})
    .on('readable', function(data) {
        this.stdout.on('data', function(chunk) {
            if (/koa server listening/.test(chunk)) {
                console.log('livereload');
                livereload.reload();
            }
            process.stdout.write(chunk);
        });
        this.stderr.pipe(process.stderr);
    });
app.listen(3000, function(err) {
    console.log('koa server listening');
});
Gulp task outputs fine when run manually, fails to output when used in gulp.watch

Gulp task outputs fine when run manually, fails to output when used in gulp.watch


By : paoletta_
Date : March 29 2020, 07:55 AM
will be helpful for those in need Ok so my hacky way to fix the problem with jetbrains (im using phpstorm), you gotta understand 2 things.
gulp watchers act on file save. jetbrains will not auto update the project files (as you have found out it uses a cache).
Problems with GULP Watch task. After compiling index.html from PUG, Gulp watch task don't refresh browser

Problems with GULP Watch task. After compiling index.html from PUG, Gulp watch task don't refresh browser


By : Jeffrey Saathoff
Date : March 29 2020, 07:55 AM
should help you out "browser-sync" only works there is tag "body". When I test this Gulp tasks, I experimented with single html tag, without .
Is there any other way to write the Watch function in Gulp, I was trying to execute a command in gulp but its showing er

Is there any other way to write the Watch function in Gulp, I was trying to execute a command in gulp but its showing er


By : user3660213
Date : March 29 2020, 07:55 AM
hop of those help? You have many lines of code that look like this:
gulp.parallel(["version:xml", "version:json"])
code :
gulp.watch("./src/**/*", ["compress"]);
  gulp.watch("./src/**/*.js", ["copy:js"]);
  gulp.watch("./src/**/*.html", ["copy:html"])
  gulp.watch("./src/**/*.html", ["copy:html"])
gulp.watch("./src/**/*", gulp.series("compress"));
  gulp.watch("./src/**/*.js", gulp.series("copy:js"));
  gulp.watch("./src/**/*.html", gulp.series("copy:html"))
  gulp.watch("./src/**/*.html", gulp.series("copy:html"))
Cannot stop Gulp with Ctrl+C when using gulp-nodemon & gulp.watch together

Cannot stop Gulp with Ctrl+C when using gulp-nodemon & gulp.watch together


By : Deepika Sahu
Date : March 29 2020, 07:55 AM
hop of those help? When I run gulp without the node task, it works fine and processes client file as expected, If I run gulp node it processes server file as expected. However if I run both gulp it processes both client and server file as expected, however, it won't let me quit by pressing 'Ctrl + C' (Tried it on windows 10 & Mac El Capitan). Is there something I'm doing wrong here? , Right at the top you have
Related Posts Related Posts :
  • Service Fabric "Waiting for upgrade..." using VSTS
  • How to convert an IndexedTable to a DataFrame in Julia?
  • Mvc5 pass model to Layout Page
  • How to set queues manager configuration to 'optional'?
  • What guarantees does zlib's inflate/deflate make about avail_in and avail_out?
  • MariaDB - embed function to automatically sum columns and store result?
  • Laravel share Auth::User() info
  • Enable keys in Azure AD application
  • Stripe Payment API with Customer and Card ID
  • iText 7 relative column width no longer working starting iText 7.0.2
  • Customer Master - Contact Person details
  • How to express inheritance in Coq?
  • Sending direct message to a bot in slack and get the response
  • Yii2 dropDownList Default value
  • MSMQ. Who can create a local queue (permissions required)?
  • how to pass angular 2 $scope variables into the Node.js server
  • root undoing previous changes after sudo su user
  • Create X509 Certificate from.p12 or .pem certificate
  • Keras layer.set_weights doesn't modify the layer. Why?
  • Available build tasks in TFS 2017
  • Change oracle apex database user
  • How to parse typesafe config with objects
  • Is "Comment" a protected word in the Open API 3.0 spec or Swagger Editor?
  • Display Percentage in a Row in Tableau
  • Bokeh Colorbar Vertical title to right of colorbar?
  • Why the multi-ports model can't import into C++?
  • Nativescript tab page textfield
  • Why does this greedy algorithm work?
  • Nested list mapping using MapStruct
  • How to I find the original row index of a table in a google visualization if I have a filtered rows view
  • Ribbon icon doesn't show up in Word Online
  • Fitting user defined function with MPFIT in IDL
  • yii2 user CRUD create or update with password
  • Does Perl 6 performance suffer by using rationals for decimal numbers
  • How to get Y value at a given X value of a trendline
  • ElastAlert flatline not finding results
  • CSS not extracted for common chunk with extract-text-webpack-plugin
  • Adding element to nested vector
  • How can I trigger an action after updating a Podio Category on zapier?
  • Ninject.MVC5 Release Scope Never Called - OutOfMemoryException
  • Grok custom time format
  • How can I avoid Same Origin Policy exception when using AWS API Gateway and CloudFront
  • How to test ActionCable with Capybara and poltergeist inside Docker?
  • opendaylight: how to include a library jar file?
  • OpenThread using Nest Learning Thermostat
  • In Coq, how to remove a defined variable from the namespace?
  • Adobe DTM Mobile Tracking Rules
  • Accessing Vuex submodules inner state with the $store object
  • Include one widget instead of excluding all others
  • Create folder temp in mac using lotuscript
  • RSU placement in veins/SUMO
  • Exclamation Unary operator stopped working on bindings
  • RxJs how to merge two overlapping observable into one
  • How to add Nuget Package Source at runtime?
  • Absolute positioning a FlatList item react-native
  • Python, using variables in pymodbus.utilities.computeCRC
  • Akamai CDN - Whitelist service by Request header or User agent
  • UIWebView/WKWebView crash on iOS11 (ran out of executable memory)
  • Is ZonePlayerId capability still working?
  • Testing polynomial definition (from natural numbers to integers)
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org