Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to specify 'the rest'? #22

Open
mcblum opened this issue Jan 19, 2016 · 6 comments
Open

Way to specify 'the rest'? #22

mcblum opened this issue Jan 19, 2016 · 6 comments

Comments

@mcblum
Copy link

mcblum commented Jan 19, 2016

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

@Nate-Wilkins
Copy link

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?

@Gobd
Copy link

Gobd commented May 26, 2016

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.

@Nate-Wilkins
Copy link

So in my example it would look something like

var dependencies = gulp.src(mainBowerFiles('**/*'), { read: false })
    .pipe(order([
      '**/normalize.css',
      '**/*'
    ]));

@Gobd
Copy link

Gobd commented Jun 8, 2016

Yes that would probably work, I've never done it without file extensions but it looks good.

@Nate-Wilkins
Copy link

Yeah that worked, thanks!

@arafat-amin
Copy link

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')); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants