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

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

    1. <tfoot id='otcky'></tfoot>

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

      2. 在 gulpfile.js 中設置工作目錄?

        Set working directory in gulpfile.js?(在 gulpfile.js 中設置工作目錄?)
        <legend id='iXhOy'><style id='iXhOy'><dir id='iXhOy'><q id='iXhOy'></q></dir></style></legend>

              <bdo id='iXhOy'></bdo><ul id='iXhOy'></ul>
              • <small id='iXhOy'></small><noframes id='iXhOy'>

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

                  <tbody id='iXhOy'></tbody>
                • <tfoot id='iXhOy'></tfoot>
                  本文介紹了在 gulpfile.js 中設置工作目錄?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  有沒有辦法在 gulpfile 中設置 Gulp 的工作目錄,這樣我就可以從子目錄運行 gulp 命令而不會遇到任何問題?我對此進行了搜索,但沒有找到我要查找的內容.

                  Is there a way to set the working directory for Gulp within a gulpfile, so that I can run a gulp command from a subdirectory without running into any issues? I ran a search for this and didn't find what I was looking for.

                  為了澄清,我知道為我正在使用的文件添加前綴.然而,而不是這個 -

                  To clarify, I'm aware of adding a prefix to the files I'm using. However, instead of this -

                  var gulp = require('gulp');
                  var jshint = require('gulp-jshint');
                  ...
                  
                  var paths = {
                      js: [__dirname + 'app/*/*.js', __dirname + '!app/lib/**'],
                      css: __dirname + 'app/*/*.styl',
                      img: __dirname + 'app/img/*',
                      index: __dirname + '*.html',
                      dist: __dirname + 'dist'
                  };
                  

                  我想做這樣的事情:

                  var gulp = require('gulp');
                  var jshint = require('gulp-jshint');
                  ...
                  
                  gulp.cwd(__dirname); // This would be much easier to understand, and would make future edits a bit safer.
                  
                  var paths = {
                      js: ['app/*/*.js', '!app/lib/**'],
                      css: 'app/*/*.styl',
                      img: 'app/img/*',
                      index: '*.html',
                      dist: 'dist'
                  };
                  

                  我想知道 Gulp 是否公開了這個功能.也許節點本身允許這樣做.

                  I'm wondering if Gulp exposes this functionality. Perhaps node itself allows this.

                  (我意識到當我運行命令時可能有一種方法可以自己執行命令行,但我想將它包含在 gulp 文件中,特別是出于分發目的.我希望 gulp 的工作目錄與gulpfile 所在的目錄.)

                  (I realize that there is likely a way to do command line itself when I run the command, but I would like to include it in the gulp file, especially for distribution purposes. I want the working directory for gulp to match the directory in which the gulpfile resides.)

                  謝謝!

                  推薦答案

                  你應該使用 path.join 因為它會處理正確的斜線,并且按照該路徑您可以添加一個快捷方式:

                  Instead of concatenating strings by yourself, you should be using path.join since it will take care of the proper slash, and following that path you can add a shorcut:

                  var path = require('path'),
                      p    = function () {
                  
                      Array
                          .prototype
                          .unshift
                          .call(arguments, __dirname);
                  
                      return path.join.apply(path, arguments);
                  };
                  
                  console.log(p('a', 'b', 'c'));
                  

                  或者,你可以:

                  gulp.src(..., {cwd: __dirname})
                  gulp.dest(..., {cwd: __dirname})
                  

                  類似:

                  var src = function (globs, options) {
                  
                      options = options || {};
                      options.cwd = __dirname;
                  
                      return gulp.src(globs, options);
                  };
                  
                  var dest = function (folder, options) {
                  
                      options = options || {};
                      options.cwd = __dirname;
                  
                      return gulp.dest(folder, options);
                  };
                  

                  看這里和這里.

                  這篇關于在 gulpfile.js 中設置工作目錄?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 崩潰)
                  <tfoot id='bMr8X'></tfoot>
                      <tbody id='bMr8X'></tbody>
                      <bdo id='bMr8X'></bdo><ul id='bMr8X'></ul>

                    • <small id='bMr8X'></small><noframes id='bMr8X'>

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

                        1. <i id='bMr8X'><tr id='bMr8X'><dt id='bMr8X'><q id='bMr8X'><span id='bMr8X'><b id='bMr8X'><form id='bMr8X'><ins id='bMr8X'></ins><ul id='bMr8X'></ul><sub id='bMr8X'></sub></form><legend id='bMr8X'></legend><bdo id='bMr8X'><pre id='bMr8X'><center id='bMr8X'></center></pre></bdo></b><th id='bMr8X'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bMr8X'><tfoot id='bMr8X'></tfoot><dl id='bMr8X'><fieldset id='bMr8X'></fieldset></dl></div>
                            主站蜘蛛池模板: 夜夜操天天操 | av片免费 | 韩日有码| 综合久久久久 | 日韩视频一区 | 在线电影日韩 | 日本高清aⅴ毛片免费 | 91精品一区二区三区久久久久久 | 一区二区三区视频 | 亚洲高清视频在线 | 午夜精品三区 | 国产精品有限公司 | 亚洲国产18 | 国产欧美精品一区二区色综合朱莉 | 久久久久国产精品 | 精品视频一区二区三区四区 | 国产免费一区二区 | 伊人99 | 国产精品一区二区福利视频 | 91在线精品一区二区 | 久久99这里只有精品 | 中文字幕亚洲一区 | 黑人巨大精品欧美一区二区免费 | 福利片在线 | 国产第一区二区 | 国产成人精品免费视频 | 91视频一区 | 国产精品久久久久久久久免费樱桃 | 中文字幕一区在线观看视频 | 久久久久国产一区二区三区四区 | 男人的天堂在线视频 | 国产在线拍偷自揄拍视频 | 激情六月丁香婷婷 | 久久久久久国产 | 亚洲成人精品 | 亚洲视频一区在线 | 亚洲视频在线一区 | 毛片免费视频 | 91精品久久久久久久久久入口 | 亚洲精品一区在线 | 精品99久久久久久 |