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

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

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

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

          <bdo id='CpnTh'></bdo><ul id='CpnTh'></ul>
      2. <legend id='CpnTh'><style id='CpnTh'><dir id='CpnTh'><q id='CpnTh'></q></dir></style></legend>
      3. 如何使用 gulp 替換文件中的字符串?

        How can I use gulp to replace a string in a file?(如何使用 gulp 替換文件中的字符串?)

            <tfoot id='mCkHe'></tfoot>

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

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

                  本文介紹了如何使用 gulp 替換文件中的字符串?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在使用 gulp 對我的 javascript 文件進行 uglify 并準備好用于生產.我所擁有的是這段代碼:

                  I am using gulp to uglify and make ready my javascript files for production. What I have is this code:

                  var concat = require('gulp-concat');
                  var del = require('del');
                  var gulp = require('gulp');
                  var gzip = require('gulp-gzip');
                  var less = require('gulp-less');
                  var minifyCSS = require('gulp-minify-css');
                  var uglify = require('gulp-uglify');
                  
                  var js = {
                      src: [
                          // more files here
                          'temp/js/app/appConfig.js',
                          'temp/js/app/appConstant.js',
                          // more files here
                      ],
                  
                  gulp.task('scripts', ['clean-js'], function () {
                      return gulp.src(js.src).pipe(uglify())
                        .pipe(concat('js.min.js'))
                        .pipe(gulp.dest('content/bundles/'))
                        .pipe(gzip(gzip_options))
                        .pipe(gulp.dest('content/bundles/'));
                  });
                  

                  我需要做的是替換字符串:

                  What I need to do is to replace the string:

                  dataServer: "http://localhost:3048",
                  

                  dataServer: "http://example.com",
                  

                  在文件'temp/js/app/appConstant.js'中,

                  In the file 'temp/js/app/appConstant.js',

                  我正在尋找一些建議.例如,也許我應該復制 appConstant.js 文件,更改它(不確定如何)并將 appConstantEdited.js 包含在 js.src 中?

                  I'm looking for some suggestions. For example perhaps I should make a copy of the appConstant.js file, change that (not sure how) and include appConstantEdited.js in the js.src?

                  但我不確定 gulp 如何復制文件并替換文件中的字符串.

                  But I am not sure with gulp how to make a copy of a file and replace a string inside a file.

                  您提供的任何幫助將不勝感激.

                  Any help you give would be much appreciated.

                  推薦答案

                  Gulp 流式輸入,執行所有轉換,然后流式輸出.使用 Gulp 時,在兩者之間保存臨時文件是 AFAIK 非慣用的.

                  Gulp streams input, does all transformations, and then streams output. Saving temporary files in between is AFAIK non-idiomatic when using Gulp.

                  相反,您正在尋找的是一種替換內容的流式傳輸方式.自己寫東西會比較容易,或者你可以使用現有的插件.對我來說,gulp-replace 效果很好.

                  Instead, what you're looking for, is a streaming-way of replacing content. It would be moderately easy to write something yourself, or you could use an existing plugin. For me, gulp-replace has worked quite well.

                  如果您想在所有文件中進行替換,您可以像這樣輕松更改任務:

                  If you want to do the replacement in all files it's easy to change your task like this:

                  var replace = require('gulp-replace');
                  
                  gulp.task('scripts', ['clean-js'], function () {
                      return gulp.src(js.src)
                        .pipe(replace(/http://localhost:d+/g, 'http://example.com'))
                        .pipe(uglify())
                        .pipe(concat('js.min.js'))
                        .pipe(gulp.dest('content/bundles/'))
                        .pipe(gzip(gzip_options))
                        .pipe(gulp.dest('content/bundles/'));
                  });
                  

                  你也可以只對你期望模式所在的文件執行 gulp.src,并通過 gulp-replace 將它們單獨流式傳輸,將其與 gulp.src 之后所有其他文件的流.

                  You could also do gulp.src just on the files you expect the pattern to be in, and stream them seperately through gulp-replace, merging it with a gulp.src stream of all the other files afterwards.

                  這篇關于如何使用 gulp 替換文件中的字符串?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='lOBTB'><style id='lOBTB'><dir id='lOBTB'><q id='lOBTB'></q></dir></style></legend>

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

                        <tfoot id='lOBTB'></tfoot>
                      • <small id='lOBTB'></small><noframes id='lOBTB'>

                            <bdo id='lOBTB'></bdo><ul id='lOBTB'></ul>
                          • 主站蜘蛛池模板: 一区二区免费高清视频 | 欧美日韩在线观看一区二区三区 | 国产激情91久久精品导航 | 国产成人精品一区二区三区四区 | 国产一区二区三区 | 国产成人精品一区二 | 美日韩精品 | 国产91成人 | 超碰电影| 蜜桃毛片 | 欧美久久不卡 | 国产成人免费视频 | 久草精品视频 | 午夜电影在线播放 | 97国产精品 | 91影院在线观看 | 亚洲国产精品一区二区三区 | 久久国产欧美日韩精品 | 国产午夜精品理论片a大结局 | 可以免费观看的av片 | 色精品 | 韩国成人在线视频 | 欧美亚洲国产日韩 | 亚洲一区二区日韩 | 毛片黄片免费看 | 久草网址 | 国产成人精品综合 | 欧美日韩在线观看一区 | 成人在线观看免费 | 亚洲麻豆 | 精品久久99 | 国产精品一区二区三区在线 | 亚洲精品久久久一区二区三区 | 9久久婷婷国产综合精品性色 | 午夜影院在线免费观看视频 | 免费高清av | 日本黄色片免费在线观看 | 天天爽天天操 | 国产精品成人国产乱一区 | 99精品在线观看 | a爱视频 |