gulp-order
gulp-order copied to clipboard
Way to specify 'the rest'?
Trying to get jQuery to load first so the rest of its dependencies will work. The issue is I'm using this in conjunction with main-bower-files. Is there a way to say: load jQuery first and then put everything else after that?
Thank you! Matt
I'm doing something very similar.
var dependencies = gulp.src(mainBowerFiles('**/*'), { read: false })
.pipe(order([
'normalize.css'
]));
trying to get normalize to order first while respecting the original sort order, which doesn't seem to be working... Any progress on this?
gulp.task('js', function() {
return gulp.src(mainBowerFiles('**/*.js').concat(['src/**/*.js'])
.pipe(order([
"**/jquery.js", "**/app.js", "**/*.js"
]))
.pipe(uglify())
.pipe(concat('min.js'))
.pipe(gulp.dest('./dist/js'))
.on('end', reload);
});
That should work for you guys. Let me know if you're still interest/have any problems with it and I can offer some help. It took me a while to figure it out on my own.
gulp-order seems to work perfectly fine the docs just aren't the most clear on how to get this to work.
So in my example it would look something like
var dependencies = gulp.src(mainBowerFiles('**/*'), { read: false })
.pipe(order([
'**/normalize.css',
'**/*'
]));
Yes that would probably work, I've never done it without file extensions but it looks good.
Yeah that worked, thanks!
Hi guys, hi @Gobd This way does not work as I expected, so anyone can lend a hand please:
function minifyJS() { return src('src/js/**/*.js') .pipe(order([ 'src/js/jquery.js', 'src/js/**/*.js', 'src/js/script.js' ])) .pipe(concat('bundle.js')) .pipe(terser()) .pipe(dest('dist/js')); }