久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <tfoot id='J3FDX'></tfoot>
      <i id='J3FDX'><tr id='J3FDX'><dt id='J3FDX'><q id='J3FDX'><span id='J3FDX'><b id='J3FDX'><form id='J3FDX'><ins id='J3FDX'></ins><ul id='J3FDX'></ul><sub id='J3FDX'></sub></form><legend id='J3FDX'></legend><bdo id='J3FDX'><pre id='J3FDX'><center id='J3FDX'></center></pre></bdo></b><th id='J3FDX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='J3FDX'><tfoot id='J3FDX'></tfoot><dl id='J3FDX'><fieldset id='J3FDX'></fieldset></dl></div>

      <small id='J3FDX'></small><noframes id='J3FDX'>

      <legend id='J3FDX'><style id='J3FDX'><dir id='J3FDX'><q id='J3FDX'></q></dir></style></legend>
        <bdo id='J3FDX'></bdo><ul id='J3FDX'></ul>

        我可以將 gulp livereload 設置為在所有文件編譯后運

        Can I set gulp livereload to run after all files are compiled?(我可以將 gulp livereload 設置為在所有文件編譯后運行嗎?)
        <i id='qdQ1o'><tr id='qdQ1o'><dt id='qdQ1o'><q id='qdQ1o'><span id='qdQ1o'><b id='qdQ1o'><form id='qdQ1o'><ins id='qdQ1o'></ins><ul id='qdQ1o'></ul><sub id='qdQ1o'></sub></form><legend id='qdQ1o'></legend><bdo id='qdQ1o'><pre id='qdQ1o'><center id='qdQ1o'></center></pre></bdo></b><th id='qdQ1o'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qdQ1o'><tfoot id='qdQ1o'></tfoot><dl id='qdQ1o'><fieldset id='qdQ1o'></fieldset></dl></div>

          <small id='qdQ1o'></small><noframes id='qdQ1o'>

          1. <tfoot id='qdQ1o'></tfoot>
              <tbody id='qdQ1o'></tbody>
            <legend id='qdQ1o'><style id='qdQ1o'><dir id='qdQ1o'><q id='qdQ1o'></q></dir></style></legend>

            • <bdo id='qdQ1o'></bdo><ul id='qdQ1o'></ul>

                1. 本文介紹了我可以將 gulp livereload 設置為在所有文件編譯后運行嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我已經設置了一個 gulp 來使用 Stylus、Jade 和 tiny-lr.我的問題是,當我保存一個玉文件時,它開始編譯它們,因此在我當前正在處理的文件被編譯之前,實時重新加載會在復制到目標的第一個文件上觸發,導致我不得不手動刷新.我已經使用gulp-changed"解決了這個問題,但我似乎無法配置它或其他東西.以前有人遇到過這個問題嗎?我正在發布我的 Gulp 文件,以便您查看.

                  I've got a gulp set up to work with Stylus, Jade and tiny-lr. My problem is that when I save one jade file, it start's compiling them all, therefore live reloading fires on the first file copied to the destination, before the file I am working on currently is compiled, resulting in me having to refresh manually. I have fixing this issue using "gulp-changed" but I don't seem to be able to configure it or something. Anyone had this problem before? I am posting my Gulp file so you can take a look.

                  可以在此處找到問題的時間線圖:https:///www.dropbox.com/s/3g37oy25s9mq969/jade_compile_frefresh_problem.png?dl=0

                  A timeline diagram of the problem can be found here: https://www.dropbox.com/s/3g37oy25s9mq969/jade_compile_frefresh_problem.png?dl=0

                  感謝任何幫助!

                      'use strict';
                  
                      var gulp = require('gulp');
                      var jade = require('gulp-jade');
                      var gutil = require('gulp-util');
                      var stylus = require('gulp-stylus');
                      var jeet = require('jeet');
                      var nib = require('nib');
                      var uglify = require('gulp-uglify');
                      var lr = require('tiny-lr')();
                      // var mainBowerFiles = require('main-bower-files');
                  
                      // Define sources object
                      var sources = {
                        jade: "jade/**/*.jade",
                        partials: "partials/**/*.jade",
                        stylus: "styl/**/*.styl",
                        scripts: "js/**/*.js"
                      };
                  
                      // Define destinations object
                  
                      var destinations = {
                        html: "dist/",
                        css: "dist/css",
                        js: "dist/js"
                      };
                  
                      // Compile and copy Jade
                      gulp.task("jade", function(event) {
                        return gulp.src(sources.jade)
                        .pipe(jade({
                          pretty: true
                        })).pipe(gulp.dest(destinations.html));
                      });
                  
                      // Compile and copy Stylus
                      gulp.task("stylus", function(event) {
                        return gulp.src(sources.stylus).pipe(stylus({
                          use: [nib(), jeet()],
                          import: [
                            'nib',
                            'jeet'
                          ],
                          style: "compressed"
                        })).pipe(gulp.dest(destinations.css));
                      });
                  
                      // Minify and copy all JavaScript
                      gulp.task('scripts', function() {
                        gulp.src(sources.scripts)
                          .pipe(uglify())
                          .pipe(gulp.dest(destinations.js));
                      });
                  
                      // Consolidate Bower Files and copy to /dist/js/
                      // gulp.task('bower-files', function() {
                      //   return gulp.src(mainBowerFiles(/* options */), {})
                      //     .pipe(gulp.dest(destinations.js));
                      // });
                  
                      // Watch for file changes and execute tasks
                      gulp.task("watch", function() {
                        gulp.watch(sources.jade, ["jade"]);
                        gulp.watch(sources.partials, ["jade"]);
                        gulp.watch(sources.stylus, ["stylus"]);
                        gulp.watch(sources.scripts, ["scripts"]);
                        gulp.watch('dist/**/*', refresh);
                      });
                  
                      // Live Reload
                      gulp.task('serve', function () {
                        var express = require('express');
                        var app = express();
                        app.use(require('connect-livereload')());
                        app.use(express.static(__dirname+'/dist/'));
                        app.listen(4000, '0.0.0.0');
                        lr.listen(35729);
                      });
                  
                      // Define default task
                      gulp.task("default", ["jade", "stylus", "scripts", "serve", "watch"]);
                  
                      // Refresh function
                      var refresh = function(event) {
                        var fileName = require('path').relative(__dirname, event.path);
                        gutil.log.apply(gutil, [gutil.colors.magenta(fileName), gutil.colors.cyan('built')]);
                        lr.changed({
                          body: { files: [fileName] }
                        });
                      };
                  

                  推薦答案

                  我已經通過在我的 gulpfile.js 中編寫一個簡單的 javascript 函數來實現這一點

                  I have achieve this by writing a simple javascript function in my gulpfile.js

                  我這樣做是因為當我編譯我的 sass 文件時,livereload 會運行大約 10 次,這種方法會使其只運行一次.

                  I did this because when I compile my sass files, livereload will run around 10 times, this method will make it only run once.

                  我的 gulpfile.js

                  gulp.task('watch', function() {
                      $.livereload.listen();
                  
                      gulp.watch([
                          path.join(config.path.app, 'media/js/**/*.js'),
                          path.join(config.path.app, 'media/css/**/*.css'),
                          path.join(config.path.app, 'templates/**/*.html')
                      ]).on('change', stackReload);
                  
                      // a timeout variable
                      var timer = null;
                  
                      // actual reload function
                      function stackReload() {
                          var reload_args = arguments;
                  
                          // Stop timeout function to run livereload if this function is ran within the last 250ms
                          if (timer) clearTimeout(timer);
                  
                          // Check if any gulp task is still running
                          if (!gulp.isRunning) {
                              timer = setTimeout(function() {
                                  $.livereload.changed.apply(null, reload_args);
                              }, 250);
                          }
                      }
                  
                  });
                  

                  這篇關于我可以將 gulp livereload 設置為在所有文件編譯后運行嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務)
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)

                      <tbody id='cQekQ'></tbody>
                  1. <small id='cQekQ'></small><noframes id='cQekQ'>

                    <legend id='cQekQ'><style id='cQekQ'><dir id='cQekQ'><q id='cQekQ'></q></dir></style></legend>
                    <i id='cQekQ'><tr id='cQekQ'><dt id='cQekQ'><q id='cQekQ'><span id='cQekQ'><b id='cQekQ'><form id='cQekQ'><ins id='cQekQ'></ins><ul id='cQekQ'></ul><sub id='cQekQ'></sub></form><legend id='cQekQ'></legend><bdo id='cQekQ'><pre id='cQekQ'><center id='cQekQ'></center></pre></bdo></b><th id='cQekQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cQekQ'><tfoot id='cQekQ'></tfoot><dl id='cQekQ'><fieldset id='cQekQ'></fieldset></dl></div>
                      • <bdo id='cQekQ'></bdo><ul id='cQekQ'></ul>

                        • <tfoot id='cQekQ'></tfoot>

                            主站蜘蛛池模板: 一二区电影 | 色爽女| 中文精品一区二区 | 91久久综合 | 美女一区| 在线免费观看黄色 | 99热激情| 国产一区二区精品在线观看 | 国产精品日产欧美久久久久 | 成人在线一区二区三区 | 免费久久久 | 色就是色欧美 | 成人亚洲视频 | 欧美淫片 | 日韩视频在线观看 | 日本三级线观看 视频 | 国产精品1 | 亚洲国产精品一区二区三区 | 中文字幕一区二区三区四区五区 | 国产成人综合网 | 97超碰成人 | 国产精品精品3d动漫 | 久久r免费视频 | 夜夜夜夜夜夜曰天天天 | 精品国产一区二区三区免费 | 久久久一区二区三区四区 | 日韩在线观看一区 | 日日噜噜噜夜夜爽爽狠狠视频, | 激情欧美一区二区三区中文字幕 | 妞干网视频 | 一区二区三区精品在线视频 | 日韩在线小视频 | 国产99久久精品 | 国产 日韩 欧美 在线 | 欧美日韩综合一区 | 日韩影音 | 亚洲高清视频在线 | 精品在线一区二区三区 | 久久精品一区 | 黄在线免费观看 | 99精品国产一区二区青青牛奶 |