Gulp-concate连接jquery两次

时间:2017-11-09 17:28:37

标签: gulp bower gulp-concat

我有2个以上的组件由凉亭安装。当我将所有javascript文件连接成一个时,gulp将jquery放入文件中。记录器写入两次jquery,但路径不同。

  

bower_components / jquery的/ DIST /的jquery.js

     

...

     

bower_components / jQuery的/ DIST /的jquery.js

     

...

这很奇怪,因为没有jQuery目录,也不能是两个同名的目录。这是gulp功能

gulp.task('bower-js', function() {
    var jsFiles = ['src/js/*'];
    gulp.src(mainBowerFiles('**/*.js', { base: 'bower_components' }))
                .pipe(gulpPrint(path => {
                     console.log(path);
                   }))
                .pipe(plugins.concat('vendor.bundle.js'))
                .pipe(plugins.rename(function (path) {
                    path.basename += ".min";
                    path.extname = ".js"
                  }))
//              .pipe(plugins.uglify())
                .pipe(gulp.dest(dest ));
});

bower.json

"dependencies": {
    "jquery": "3.2.1",
    "font-awesome": "^4.7.0",
    "js-cookie": "^2.1.4",
    "blockUI": "*",
    "eonasdan-bootstrap-datetimepicker": "^4.17.47",
    "bootstrap-datepicker": "^1.7.1",
    "bootstrap-timepicker": "^0.5.2",
    "smalot-bootstrap-datetimepicker": "^2.4.4",
    "bootstrap-daterangepicker": "^2.1.25",
    "bootstrap-touchspin": "^3.1.2",
    "bootstrap-maxlength": "^1.7.0",
    "bootstrap-switch": "^3.3.4",
    "css-toggle-switch": "^4.0.3",
    "bootstrap-selectsplitter": "^0.1.4",
    "select2": "^4.0.3",
    "bootstrap-select": "^1.12.4",
    "typeahead.js": "^0.11.1",
    "ion.rangeSlider": "ionrangeslider#^2.1.7",
    "jqlite": "kilt-jqlite#^0.2.42",
    "inputmask": "^3.3.7",
    "autosize": "^4.0.0",
    "dropzone": "^5.1.1",
    "bootstrap-markdown": "^2.10.0",
    "jstree": "^3.3.4",
    "remarkable-bootstrap-notify": "^3.1.3",
    "Flot": "jquery-flot#^0.8.3",
    "morris.js": "^0.5.1",
    "raphael": "^2.2.7",
    "gmaps": "^0.4.25",
    "jqvmap": "^1.5.1",
    "jquery-idletimer": "^1.0.2",
    "bootstrap-session-timeout": "^1.0.3",
    "chart.js": "^2.6.0",
    "chartist": "^0.11.0",
    "waypoints": "^4.0.1",
    "counter-up": "^1.0.0",
    "jquery-form": "^4.2.1",
    "bootstrap": "v4.0.0-beta",
    "PACE": "pace#^1.0.2",
    "rangeslider.js": "^2.3.1",
    "angular": "^1.6.6",
    "summernote": "^0.8.8",
    "jquery-validation": "^1.17.0",
    "datatables.net": "^1.10.16"
  },
  "resolutions": {
    "jquery": "~3.2.1"
  }

0 个答案:

没有答案