Вход

Просмотр полной версии : GulpJS, не работает сортировка


Sanu0074
04.06.2015, 13:36
Почему он собирает файлы (в каком-то своем) случайном порядке, а не как перечислено в order()?
var gulp = require('gulp'),
concat = require('gulp-concat'),
order = require("gulp-order"),
uglify = require('gulp-uglify');

gulp.task('scripts', function () {
gulp.src('pack-js/*.js')
.pipe(order([
"pack-js/acc.common.js",
"pack-js/acc.userlocation.js",
"pack-js/acc.track.js",
"pack-js/acc.cms.js",
"pack-js/acc.product.js",
"pack-js/acc.refinements.js",
"pack-js/acc.storefinder.js",
"pack-js/acc.carousel.js",
"pack-js/acc.autocomplete.js",
"pack-js/acc.pstrength.js",
"pack-js/acc.password.js",
"pack-js/acc.minicart.js",
"pack-js/acc.pickupinstore.js",
"pack-js/acc.orderapproval.js",
"pack-js/acc.langcurrencyselector.js",
"pack-js/acc.paginationsort.js",
"pack-js/acc.checkout.js",
"pack-js/acc.address.js",
"pack-js/acc.refresh.js",
"pack-js/acc.stars.js",
"pack-js/acc.forgotpassword.js",
"pack-js/acc.productDetail.js",
"pack-js/acc.producttabs.js",
"pack-js/acc.variantdetails.js"
]))
.pipe(concat('build.common.js'))
.pipe(uglify())
.pipe(gulp.dest('js'));
});

gulp.task('default', function() {
gulp.run('scripts');

gulp.watch('pack-js/**', function(event) {
gulp.run('scripts');
})

});

Sanu0074
04.06.2015, 15:06
сделал так
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');

gulp.task('scripts', function () {
gulp.src([
"pack-js/jquery.accessible-tabs-1.9.7.min",
"pack-js/acc.common.js",
"pack-js/acc.userlocation.js",
"pack-js/acc.track.js",
"pack-js/acc.cms.js",
"pack-js/acc.product.js",
"pack-js/acc.refinements.js",
"pack-js/acc.storefinder.js",
"pack-js/acc.carousel.js",
"pack-js/acc.autocomplete.js",
"pack-js/acc.pstrength.js",
"pack-js/acc.password.js",
"pack-js/acc.minicart.js",
"pack-js/acc.pickupinstore.js",
"pack-js/acc.orderapproval.js",
"pack-js/acc.langcurrencyselector.js",
"pack-js/acc.paginationsort.js",
"pack-js/acc.checkout.js",
"pack-js/acc.address.js",
"pack-js/acc.refresh.js",
"pack-js/acc.stars.js",
"pack-js/acc.forgotpassword.js",
"pack-js/acc.productDetail.js",
"pack-js/acc.producttabs.js",
"pack-js/acc.variantdetails.js"
])
.pipe(concat('build.common.js'))
.pipe(uglify())
.pipe(gulp.dest('js'));
});

gulp.task('default', function() {
gulp.run('scripts');

gulp.watch('pack-js/**', function(event) {
gulp.run('scripts');
})

});
результат тот же! порядок не сохраняется

Sanu0074
04.06.2015, 15:22
все, проблема решена

Safort
05.06.2015, 02:15
Sanu0074,
а, собственно, в чём была проблема?