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

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

      <tfoot id='t9qRC'></tfoot>

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

        <bdo id='t9qRC'></bdo><ul id='t9qRC'></ul>

      Gulp less 未正確處理包含未定義的包含變量

      Gulp less not handling includes properly, included variables not defined(Gulp less 未正確處理包含未定義的包含變量)

      <i id='J0IME'><tr id='J0IME'><dt id='J0IME'><q id='J0IME'><span id='J0IME'><b id='J0IME'><form id='J0IME'><ins id='J0IME'></ins><ul id='J0IME'></ul><sub id='J0IME'></sub></form><legend id='J0IME'></legend><bdo id='J0IME'><pre id='J0IME'><center id='J0IME'></center></pre></bdo></b><th id='J0IME'></th></span></q></dt></tr></i><div class="7rx7tbr" id='J0IME'><tfoot id='J0IME'></tfoot><dl id='J0IME'><fieldset id='J0IME'></fieldset></dl></div>

        <tfoot id='J0IME'></tfoot>
          <bdo id='J0IME'></bdo><ul id='J0IME'></ul>

        • <legend id='J0IME'><style id='J0IME'><dir id='J0IME'><q id='J0IME'></q></dir></style></legend>
                <tbody id='J0IME'></tbody>
            1. <small id='J0IME'></small><noframes id='J0IME'>

                本文介紹了Gulp less 未正確處理包含未定義的包含變量的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                限時送ChatGPT賬號..

                我正在使用 less 和 Grunt,并且正在轉(zhuǎn)向 gulp.

                I am using less and Grunt, and am moving to gulp.

                我的少工作.當(dāng)我跑步時:

                My less works. When I run:

                lessc public/less/myapp.less
                

                我得到了沒有錯誤的工作輸出.我所有的 less,包括 include,都是 public/less,順便說一句.這是我的 gulpfile:

                I get working output with no errors. All my less, including includes, is in public/less, BTW. Here is my gulpfile:

                var gulp = require('gulp');
                var prefixer = require('gulp-autoprefixer');
                var less = require('gulp-less');
                
                gulp.task('compileLess', function () {
                  gulp
                    .src('./public/less/*')
                    .pipe(less({
                      paths: ['./public/less'], // Search paths for imports
                      filename: 'myapp.less'
                    }))
                    .pipe(gulp.dest('./public/css'));
                });
                
                // The default task (called when you run `gulp`)
                gulp.task('default', function() {
                  gulp.run('compileLess');
                
                  // Watch files and run tasks if they change
                  gulp.watch('./public/less/*.less', function(event) {
                    gulp.run('less');
                  });
                });
                

                當(dāng)我運行 gulp 時,我得到:

                When I run gulp, I get:

                ~/Documents/myapp: gulp
                [gulp] Using file /Users/me/Documents/myapp/gulpfile.js
                [gulp] Working directory changed to /Users/me/Documents/myapp
                [gulp] Running 'default'...
                [gulp] Running 'compileLess'...
                [gulp] Finished 'compileLess' in 11 ms
                [gulp] Finished 'default' in 41 ms
                
                stream.js:94
                      throw er; // Unhandled stream error in pipe.
                            ^
                Error: variable @brightblue is undefined
                

                @brightblue 在 myapp.less 開始處導(dǎo)入的文件中定義.

                @brightblue is defined, in a file imported at the start of myapp.less.

                @import "./colors.less";
                body {
                  background-color: @brightblue;
                }
                

                • 為什么 gulp 不接收我的包含?為 less 指定 'paths' 選項應(yīng)該可以讓它工作,但它并沒有修復(fù)它.
                • 有什么好的調(diào)試方法?例如,我沒有行號.
                • 有沒有辦法讓 gulp 工作?
                • 推薦答案

                  不同之處在于 我正在編譯:

                  The difference was what I was compiling:

                  • 當(dāng)我運行 lessc myapp.less 時,我正在編譯主 less 文件及其依賴項
                  • 當(dāng)我使用上面的 gulpfile 運行 gulp 時,我正在單獨編譯每個 less 文件,因為 gulp.src 是 *.less 而不是 myapp.less.由于這些 less 文件僅從主 less 文件加載,因此它們沒有 @imports 用于它們所依賴的東西(因為 myapp.less 依賴于它們).例如,在每個單獨的文件中導(dǎo)入theme.less"而不是先在 myapp.less 中導(dǎo)入它是沒有意義的.
                  • When I ran lessc myapp.less, I was compiling the main less file and it's dependencies
                  • When I ran gulp using the gulpfile above, I was compiling each less file individually, because gulp.src was *.less not myapp.less. Since these less files are only ever loaded from the main less file, they didn't have @imports for the things they depend on (because myapp.less depends on them). Eg, there's no point importing, say, 'theme.less' in every individual file rather than just importing it first in myapp.less.

                  這是工作版本:

                  // Run 'gulp' to do the important stuff
                  var gulp = require('gulp');
                  var prefixer = require('gulp-autoprefixer');
                  var less = require('gulp-less');
                  var path = require('path');
                  
                  gulp.task('less', function () {
                    gulp
                      .src('./public/less/myapp.less') // This was the line that needed fixing
                      .pipe(less({
                        paths: ['public/less']
                      }))
                      .pipe(prefixer('last 2 versions', 'ie 9'))
                      .pipe(gulp.dest('./public/css'));
                  });
                  
                  // The default task (called when you run `gulp`)
                  gulp.task('default', function() {
                    gulp.run('less');
                  
                    // Watch files and run tasks if they change
                    gulp.watch('./public/less/*.less', function(event) {
                      gulp.run('less');
                    });
                  });
                  

                  請參閱下面的@noducks 回答,了解適用于最新 gulp 的改進版本.

                  see @noducks answer below for an improved version that works with the latest gulp.

                  這篇關(guān)于Gulp less 未正確處理包含未定義的包含變量的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                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 以使其以不同的方式運行任務(wù)?)
                Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務(wù))
                Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)

                    <legend id='cwd7e'><style id='cwd7e'><dir id='cwd7e'><q id='cwd7e'></q></dir></style></legend>

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

                      <bdo id='cwd7e'></bdo><ul id='cwd7e'></ul>
                          <tbody id='cwd7e'></tbody>

                          <tfoot id='cwd7e'></tfoot>
                        1. <i id='cwd7e'><tr id='cwd7e'><dt id='cwd7e'><q id='cwd7e'><span id='cwd7e'><b id='cwd7e'><form id='cwd7e'><ins id='cwd7e'></ins><ul id='cwd7e'></ul><sub id='cwd7e'></sub></form><legend id='cwd7e'></legend><bdo id='cwd7e'><pre id='cwd7e'><center id='cwd7e'></center></pre></bdo></b><th id='cwd7e'></th></span></q></dt></tr></i><div class="db7p7rx" id='cwd7e'><tfoot id='cwd7e'></tfoot><dl id='cwd7e'><fieldset id='cwd7e'></fieldset></dl></div>
                          主站蜘蛛池模板: 检验科改造施工_DSA手术室净化_导管室装修_成都特殊科室建设厂家_医疗净化工程公司_四川华锐 | Dataforth隔离信号调理模块-信号放大模块-加速度振动传感器-北京康泰电子有限公司 | 耐热钢-耐磨钢-山东聚金合金钢铸造有限公司 | 车充外壳,车载充电器外壳,车载点烟器外壳,点烟器连接头,旅行充充电器外壳,手机充电器外壳,深圳市华科达塑胶五金有限公司 | 恒温槽_恒温水槽_恒温水浴槽-上海方瑞仪器有限公司 | 建大仁科-温湿度变送器|温湿度传感器|温湿度记录仪_厂家_价格-山东仁科 | 跨境物流_美国卡派_中大件运输_尾程派送_海外仓一件代发 - 广州环至美供应链平台 | 标准光源箱|对色灯箱|色差仪|光泽度仪|涂层测厚仪_HRC大品牌生产厂家 | 100国际学校招生 - 专业国际学校择校升学规划| 四合院设计_四合院装修_四合院会所设计-四合院古建设计与建造中心1 | 气动隔膜泵厂家-温州永嘉定远泵阀有限公司 | MES系统-WMS系统-MES定制开发-制造执行MES解决方案-罗浮云计算 | 2-羟基泽兰内酯-乙酰蒲公英萜醇-甘草查尔酮A-上海纯优生物科技有限公司 | EFM 022静电场测试仪-套帽式风量计-静电平板监测器-上海民仪电子有限公司 | 郑州爱婴幼师学校_专业幼师培训_托育师培训_幼儿教育培训学校 | 真空泵维修保养,普发,阿尔卡特,荏原,卡西亚玛,莱宝,爱德华干式螺杆真空泵维修-东莞比其尔真空机电设备有限公司 | 烘箱-工业烘箱-工业电炉-实验室干燥箱 - 苏州华洁烘箱制造有限公司 | 斗式提升机,斗式提升机厂家-淄博宏建机械有限公司 | 液压油缸生产厂家-山东液压站-济南捷兴液压机电设备有限公司 | 一路商机网-品牌招商加盟优选平台-加盟店排行榜平台 | 上海瑶恒实业有限公司|消防泵泵|离心泵|官网 | 高精度电阻回路测试仪-回路直流电阻测试仪-武汉特高压电力科技有限公司 | 电子书导航网_电子书之家_电子书大全_最新电子书分享发布平台 | 连栋温室大棚建造厂家-智能玻璃温室-薄膜温室_青州市亿诚农业科技 | 纯水电导率测定仪-万用气体检测仪-低钠测定仪-米沃奇科技(北京)有限公司www.milwaukeeinst.cn 锂辉石检测仪器,水泥成分快速分析仪-湘潭宇科分析仪器有限公司 手术室净化装修-手术室净化工程公司-华锐手术室净化厂家 | 耐磨陶瓷管道_除渣器厂家-淄博浩瀚陶瓷科技有限公司 | 深圳VI设计-画册设计-LOGO设计-包装设计-品牌策划公司-[智睿画册设计公司] | 可程式恒温恒湿试验箱|恒温恒湿箱|恒温恒湿试验箱|恒温恒湿老化试验箱|高低温试验箱价格报价-广东德瑞检测设备有限公司 | 智能垃圾箱|垃圾房|垃圾分类亭|垃圾分类箱专业生产厂家定做-宿迁市传宇环保设备有限公司 | 河南正规膏药生产厂家-膏药贴牌-膏药代加工-修康药业集团官网 | 玉米深加工机械,玉米加工设备,玉米加工机械等玉米深加工设备制造商-河南成立粮油机械有限公司 | 水性漆|墙面漆|木器家具漆|水漆涂料_晨阳水漆官网 | 洛阳防爆合格证办理-洛阳防爆认证机构-洛阳申请国家防爆合格证-洛阳本安防爆认证代办-洛阳沪南抚防爆电气技术服务有限公司 | 防爆鼓风机-全风-宏丰鼓风机-上海梁瑾机电设备有限公司 | 精准猎取科技资讯,高效阅读科技新闻_科技猎 | 真空包装机-诸城市坤泰食品机械有限公司 | 安平县鑫川金属丝网制品有限公司,声屏障,高速声屏障,百叶孔声屏障,大弧形声屏障,凹凸穿孔声屏障,铁路声屏障,顶部弧形声屏障,玻璃钢吸音板 | 广西资质代办_建筑资质代办_南宁资质代办理_新办、增项、升级-正明集团 | 标准件-非标紧固件-不锈钢螺栓-非标不锈钢螺丝-非标螺母厂家-三角牙锁紧自攻-南京宝宇标准件有限公司 | 便携式高压氧舱-微压氧舱-核生化洗消系统-公众洗消站-洗消帐篷-北京利盟救援 | 专业生物有机肥造粒机,粉状有机肥生产线,槽式翻堆机厂家-郑州华之强重工科技有限公司 |