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

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

    1. <small id='Pr7Id'></small><noframes id='Pr7Id'>

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

      使用 gulp-usemin 不會在 html 文件中重寫 uglified 文件

      uglified files are not rewritten in html file using gulp-usemin(使用 gulp-usemin 不會在 html 文件中重寫 uglified 文件)
    2. <i id='z47Sr'><tr id='z47Sr'><dt id='z47Sr'><q id='z47Sr'><span id='z47Sr'><b id='z47Sr'><form id='z47Sr'><ins id='z47Sr'></ins><ul id='z47Sr'></ul><sub id='z47Sr'></sub></form><legend id='z47Sr'></legend><bdo id='z47Sr'><pre id='z47Sr'><center id='z47Sr'></center></pre></bdo></b><th id='z47Sr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='z47Sr'><tfoot id='z47Sr'></tfoot><dl id='z47Sr'><fieldset id='z47Sr'></fieldset></dl></div>
        <tfoot id='z47Sr'></tfoot>

            <tbody id='z47Sr'></tbody>
          <legend id='z47Sr'><style id='z47Sr'><dir id='z47Sr'><q id='z47Sr'></q></dir></style></legend>

          • <bdo id='z47Sr'></bdo><ul id='z47Sr'></ul>

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

              • 本文介紹了使用 gulp-usemin 不會在 html 文件中重寫 uglified 文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我遇到了 gulp-usemin 插件的問題.當 usemin 任務正在運行時,它正在連接和 uglifying cssjs 文件,但是 uglified 的 js 文件不會在 html 文件中重寫,盡管它是生成.我正在分享我的 gulpfile.js 和 index.html 代碼.

                I am facing a problem with gulp-usemin plugin. when usemin task is running it is concating and uglifying css and js files, but the uglified js files are not rewritten in html file though it is generated. I am sharing my gulpfile.js and index.html code .

                index.html 轉換前

                <html>
                    <head>
                        <!-- build:css build/css -->
                        <link rel="stylesheet" href="css/blue.css">
                        <link rel="stylesheet" href="css/green.css">
                        <link rel="stylesheet" href="css/orange.css">
                        <!-- endbuild -->
                        <!-- build:js build/js1 -->
                        <script src="js/add.js"></script>
                        <script src="js/sub.js"></script>
                        <script src="js/mul.js"></script>
                        <!-- endbuild -->
                    </head>
                    <body>
                
                        <p class="blue" id="sum"></p>
                        <p class="green" id="diff"></p>
                        <p class="orange" id="mul"></p>
                        <img src="images/1.jpg" width="304" height="228">
                        <img src="images/2.jpg" width="304" height="228">
                
                        <script>
                        document.getElementById('sum').innerHTML=add(4,4);
                        document.getElementById('diff').innerHTML=sub(4,4);
                        document.getElementById('mul').innerHTML=mul(4,4);
                
                        </script>
                    </body>
                </html>
                

                gulpfile.js

                var usemin = require('gulp-usemin');
                var gulp = require('gulp');
                var uglify = require('gulp-uglify');
                var minifyHtml = require('gulp-minify-html');
                var minifyCss = require('gulp-minify-css');
                var jshint = require('gulp-jshint');
                var concat = require('gulp-concat');
                var rev = require('gulp-rev'),
                    notify = require('gulp-notify');
                
                gulp.task('usemin', function() {
                  gulp.src('./*.html')
                    .pipe(usemin({
                      css: [minifyCss(), 'concat'],
                      html: [minifyHtml({empty: true})],
                      js: [uglify()]
                    }))
                    .pipe(gulp.dest('build/'));
                });
                

                index.html 轉換后

                //you can see that build/css is generated but build/js is not generated
                <html>
                    <head>
                    <link rel="stylesheet" href="build/css"/>
                
                    </head>
                    <body>
                
                    <p class="blue" id="sum"></p>
                    <p class="green" id="diff"></p>
                    <p class="orange" id="mul"></p>
                    <img src="images/1.jpg" width="304" height="228">
                    <img src="images/2.jpg" width="304" height="228">
                
                    <script>
                    document.getElementById('sum').innerHTML=add(4,4);
                    document.getElementById('diff').innerHTML=sub(4,4);
                    document.getElementById('mul').innerHTML=mul(4,4);
                
                    </script>
                    </body>
                </html>
                

                幫助我解決這個問題.提前致謝.

                Help me in fixing this issue. Thanks in advance .

                推薦答案

                首先,您在 js usemin 調用中缺少 rev,將你的 task 更改為:

                First, you are missing the rev in your js usemin call, change your task to:

                gulp.task('usemin', function() {
                
                  gulp.src('./*.html')
                    .pipe(usemin({
                      css: [minifyCss(), 'concat'],
                      html: [minifyHtml({empty: true})],
                      js: [uglify(), rev()]
                    }))
                    .pipe(gulp.dest('build/'));
                
                  });
                

                另外,gulp-useminblocks的最后一個參數代表file的路徑.您應該精確擴展名,以免與目錄混淆

                Also, the last parameter of the blocks in gulp-usemin represent the path of a file. You should precise the extension to not confuse with a directory

                <!-- build:css build/style.css -->
                
                <!-- build:js build/js1.js -->
                

                為清楚起見,您還應該在兩個不同的塊之間放置一個換行符.

                For clarity, you should also put a line break between the two different blocks.

                這篇關于使用 gulp-usemin 不會在 html 文件中重寫 uglified 文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 任務)
                Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                Detect FLASH plugin crashes(檢測 FLASH 插件崩潰)

                <small id='3OH5G'></small><noframes id='3OH5G'>

                      • <bdo id='3OH5G'></bdo><ul id='3OH5G'></ul>

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

                            <tbody id='3OH5G'></tbody>
                          <legend id='3OH5G'><style id='3OH5G'><dir id='3OH5G'><q id='3OH5G'></q></dir></style></legend>

                          <tfoot id='3OH5G'></tfoot>
                          主站蜘蛛池模板: 欧美成人a∨高清免费观看 欧美日韩中 | 国产亚洲www | av永久| 99r在线 | 亚洲久久在线 | 欧美在线视频不卡 | 亚洲国产中文在线 | 亚洲成人福利在线观看 | 一区二区三区小视频 | 亚洲精品久久视频 | 波多野结衣中文字幕一区二区三区 | 一级片网址 | 日韩色综合| 欧美日韩美女 | 国产高清视频一区 | 欧美日韩国产一区二区三区 | 精品久久久久久 | 超碰免费在线 | 99亚洲精品 | 亚洲欧美激情视频 | 成人在线中文字幕 | 成人av资源在线 | 国产免费一区二区三区最新6 | 成人在线看片 | 岛国av免费在线观看 | 国产一区二区三区日韩 | 黄色网址在线免费观看 | 国产精品久久久久久久久久妞妞 | 久久久久一区二区三区 | 国产日韩一区二区三免费高清 | 久久国产精品一区 | 插插宗合网 | 国产精品一区二区在线观看 | 亚洲欧美精品在线观看 | 精品在线播放 | 日日夜夜狠狠操 | 亚洲精品一区二区三区四区高清 | 亚洲福利在线观看 | 日韩三级免费观看 | 欧美激情视频一区二区三区在线播放 | 欧产日产国产精品v |