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

    <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="qwawimqqmiuu" 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="qwawimqqmiuu" 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 未正確處理包含未定義的包含變量的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我正在使用 less 和 Grunt,并且正在轉向 gulp.

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

                我的少工作.當我跑步時:

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

                當我運行 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 開始處導入的文件中定義.

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

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

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

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

                  The difference was what I was compiling:

                  • 當我運行 lessc myapp.less 時,我正在編譯主 less 文件及其依賴項
                  • 當我使用上面的 gulpfile 運行 gulp 時,我正在單獨編譯每個 less 文件,因為 gulp.src 是 *.less 而不是 myapp.less.由于這些 less 文件僅從主 less 文件加載,因此它們沒有 @imports 用于它們所依賴的東西(因為 myapp.less 依賴于它們).例如,在每個單獨的文件中導入theme.less"而不是先在 myapp.less 中導入它是沒有意義的.
                  • 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.

                  這篇關于Gulp less 未正確處理包含未定義的包含變量的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 崩潰)

                    <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="qwawimqqmiuu" id='cwd7e'><tfoot id='cwd7e'></tfoot><dl id='cwd7e'><fieldset id='cwd7e'></fieldset></dl></div>
                          主站蜘蛛池模板: 欧美 日韩 亚洲91麻豆精品 | 一级片在线观看 | 亚洲欧美国产视频 | 蜜臀网 | 国产十日韩十欧美 | 成人福利影院 | 日本三级全黄三级三级三级口周 | 国产做爰 | 国产高清在线观看 | www.av在线 | 午夜视频在线免费观看 | 黑人精品 | 91麻豆精品国产91久久久资源速度 | 成人超碰 | 青草青草久热精品视频在线观看 | 91精品国产综合久久久久久丝袜 | 全部免费毛片在线播放网站 | 日韩欧美专区 | 欧美成人在线网站 | 美女国产精品 | 精品美女久久久久久免费 | 欧美在线成人影院 | 日韩视频免费 | 亚洲自拍偷拍免费视频 | 97热在线 | 成人亚洲精品久久久久软件 | 国内精品久久久久久久 | 亚洲看片网站 | 亚洲精品视频免费观看 | 一级黄色毛片免费 | 久久视频免费观看 | 高清久久| 情侣酒店偷拍一区二区在线播放 | 日本精品一区二区三区在线观看视频 | 中文字幕一区二区三区四区五区 | 九九热在线观看 | 国产一级片网站 | 亚洲中字在线 | 日韩在线免费 | 亚洲国产二区 | 国产一级片免费在线观看 |