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

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

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

      <tfoot id='UWqNz'></tfoot>
      1. <i id='UWqNz'><tr id='UWqNz'><dt id='UWqNz'><q id='UWqNz'><span id='UWqNz'><b id='UWqNz'><form id='UWqNz'><ins id='UWqNz'></ins><ul id='UWqNz'></ul><sub id='UWqNz'></sub></form><legend id='UWqNz'></legend><bdo id='UWqNz'><pre id='UWqNz'><center id='UWqNz'></center></pre></bdo></b><th id='UWqNz'></th></span></q></dt></tr></i><div id='UWqNz'><tfoot id='UWqNz'></tfoot><dl id='UWqNz'><fieldset id='UWqNz'></fieldset></dl></div>
      2. Gulp 将多个 js 文件缩小为一个

        时间:2023-05-29

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

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

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

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

                <tbody id='XQBV8'></tbody>
                • 本文介绍了Gulp 将多个 js 文件缩小为一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我是 Gulp 的新手,想知道如何将我的集合缩小(连接)到单个文件而不是单独的每个文件.

                  I am new to Gulp and wondering how can I minify (concatinate) my collection to single file instead of every file separately.

                  var gulp = require('gulp');
                  var uglify = require('gulp-uglify');
                  
                  gulp.task('minify', function () {
                     gulp.src([
                          'content/plugins/jquery/jquery-2.1.1.js',
                          'content/plugins/jquery/jquery-ui.js',
                          'content/js/client.js'])
                        .pipe(uglify())
                        .pipe(gulp.dest('content/js/client.min.js')) // It will create folder client.min.js
                  });
                  
                  gulp.task('default', ['minify']);
                  

                  如您所见,我正在尝试缩小 3 个 javascript 文件,然后将它们输出到一个 client.min.js 中.有可能吗?

                  As you can see I'm trying to minify 3 javascript files and then output them into one client.min.js. Is it possible?

                  推荐答案

                  这个插件将帮助 gulp-concat.

                  用法:

                  var concat = require('gulp-concat');
                  
                  gulp.task('scripts', function() {
                    gulp.src(['./lib/file3.js', './lib/file1.js', './lib/file2.js'])
                      .pipe(concat('all.js'))
                      .pipe(uglify())
                      .pipe(gulp.dest('./dist/'))
                  });
                  

                  这篇关于Gulp 将多个 js 文件缩小为一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Browserify 和 Gulp 使用共享的公共库创建单独 下一篇:Docker 容器中的 Browsersync

                  相关文章

                  最新文章

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

                    • <bdo id='jrNcY'></bdo><ul id='jrNcY'></ul>
                    <tfoot id='jrNcY'></tfoot>

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

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