pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    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="th7hvjh" 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 設(shè)置為在所有文件編譯后運(yùn)

        Can I set gulp livereload to run after all files are compiled?(我可以將 gulp livereload 設(shè)置為在所有文件編譯后運(yùn)行嗎?)
        <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="h7jlldp" 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 設(shè)置為在所有文件編譯后運(yùn)行嗎?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我已經(jīng)設(shè)置了一個(gè) gulp 來(lái)使用 Stylus、Jade 和 tiny-lr.我的問(wèn)題是,當(dāng)我保存一個(gè)玉文件時(shí),它開(kāi)始編譯它們,因此在我當(dāng)前正在處理的文件被編譯之前,實(shí)時(shí)重新加載會(huì)在復(fù)制到目標(biāo)的第一個(gè)文件上觸發(fā),導(dǎo)致我不得不手動(dòng)刷新.我已經(jīng)使用gulp-changed"解決了這個(gè)問(wèn)題,但我似乎無(wú)法配置它或其他東西.以前有人遇到過(guò)這個(gè)問(wèn)題嗎?我正在發(fā)布我的 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.

                  可以在此處找到問(wèn)題的時(shí)間線(xiàn)圖: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] }
                        });
                      };
                  

                  推薦答案

                  我已經(jīng)通過(guò)在我的 gulpfile.js 中編寫(xiě)一個(gè)簡(jiǎn)單的 javascript 函數(shù)來(lái)實(shí)現(xiàn)這一點(diǎn)

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

                  我這樣做是因?yàn)楫?dāng)我編譯我的 sass 文件時(shí),livereload 會(huì)運(yùn)行大約 10 次,這種方法會(huì)使其只運(yùn)行一次.

                  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);
                          }
                      }
                  
                  });
                  

                  這篇關(guān)于我可以將 gulp livereload 設(shè)置為在所有文件編譯后運(yùn)行嗎?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

                            主站蜘蛛池模板: 至顶网| 工业淬火油烟净化器,北京油烟净化器厂家,热处理油烟净化器-北京众鑫百科 | 风电变桨伺服驱动器-风电偏航变桨系统-深圳众城卓越科技有限公司 | 罐体电伴热工程-消防管道电伴热带厂家-山东沃安电气 | 彩超机-黑白B超机-便携兽用B超机-多普勒彩超机价格「大为彩超」厂家 | 在线钠离子分析仪-硅酸根离子浓度测定仪-油液水分测定仪价格-北京时代新维测控设备有限公司 | 吉祥新世纪铝塑板_生产铝塑板厂家_铝塑板生产厂家_临沂市兴达铝塑装饰材料有限公司 | IWIS链条代理-ALPS耦合透镜-硅烷预处理剂-上海顶楚电子有限公司 lcd条形屏-液晶长条屏-户外广告屏-条形智能显示屏-深圳市条形智能电子有限公司 | 搪瓷反应釜厂家,淄博搪瓷反应釜-淄博卓耀 | 高光谱相机-近红外高光谱相机厂家-高光谱成像仪-SINESPEC 赛斯拜克 | 气动|电动调节阀|球阀|蝶阀-自力式调节阀-上海渠工阀门管道工程有限公司 | 建筑资质代办_工程施工资质办理_资质代办公司_北京众聚企服 | 机房监控|动环监控|动力环境监控系统方案产品定制厂家 - 迈世OMARA | 吊篮式|移动式冷热冲击试验箱-二槽冷热冲击试验箱-广东科宝 | 电杆荷载挠度测试仪-电杆荷载位移-管桩测试仪-北京绿野创能机电设备有限公司 | 分光色差仪,测色仪,反透射灯箱,爱色丽分光光度仪,美能达色差仪维修_苏州欣美和仪器有限公司 | 起好名字_取个好名字_好名网免费取好名在线打分 | 四合院设计_四合院装修_四合院会所设计-四合院古建设计与建造中心1 | 培训一点通 - 合肥驾校 - 合肥新亚驾校 - 合肥八一驾校 | 磁力链接搜索神器_BT磁力狗_CILIMAO磁力猫_高效磁力搜索引擎2024 | 全自动五线打端沾锡机,全自动裁线剥皮双头沾锡机,全自动尼龙扎带机-东莞市海文能机械设备有限公司 | 氢氧化钾厂家直销批发-济南金昊化工有限公司 | 淘趣英语网 - 在线英语学习,零基础英语学习网站 | 防水套管_柔性防水套管_刚性防水套管-巩义市润达管道设备制造有限公司 | 北京自然绿环境科技发展有限公司专业生产【洗车机_加油站洗车机-全自动洗车机】 | 低温柔性试验仪-土工布淤堵-沥青车辙试验仪-莱博特(天津)试验机有限公司 | 外贸资讯网 - 洞悉全球贸易,把握市场先机 | 齿轮减速机_齿轮减速电机-VEMT蜗轮蜗杆减速机马达生产厂家瓦玛特传动瑞环机电 | 硅胶管挤出机厂家_硅胶挤出机生产线_硅胶条挤出机_臣泽智能装备 贵州科比特-防雷公司厂家提供贵州防雷工程,防雷检测,防雷接地,防雷设备价格,防雷产品报价服务-贵州防雷检测公司 | 论文查重_免费论文查重_知网学术不端论文查重检测系统入口_论文查重软件 | 建筑资质代办_工程施工资质办理_资质代办公司_北京众聚企服 | 工业电炉,台车式电炉_厂家-淄博申华工业电炉有限公司 | 东莞猎头公司_深圳猎头公司_广州猎头公司-广东万诚猎头提供企业中高端人才招聘服务 | 今日热点_实时热点_奇闻异事_趣闻趣事_灵异事件 - 奇闻事件 | 环讯传媒,永康网络公司,永康网站建设,永康小程序开发制作,永康网站制作,武义网页设计,金华地区网站SEO优化推广 - 永康市环讯电子商务有限公司 | pbt头梳丝_牙刷丝_尼龙毛刷丝_PP塑料纤维合成毛丝定制厂_广州明旺 | 微型气泵-真空-蠕动-水泵-厂家-深圳市品亚科技有限公司 | 过滤器_自清洗过滤器_气体过滤器_苏州华凯过滤技术有限公司 | 理化生实验室设备,吊装实验室设备,顶装实验室设备,实验室成套设备厂家,校园功能室设备,智慧书法教室方案 - 东莞市惠森教学设备有限公司 | 手持式线材张力计-套帽式风量罩-深圳市欧亚精密仪器有限公司 | 抖音短视频运营_企业网站建设_网络推广_全网自媒体营销-东莞市凌天信息科技有限公司 |