Giter Club home page Giter Club logo

Comments (1)

ahaurw01 avatar ahaurw01 commented on June 26, 2024
  1. Your call to order() needs to go after your coffeeFilter.restore(), otherwise it is ordering only coffee files.
  2. Your order(...) uses the src array as ordering instructions which hard-coded a.coffee. By the time gulp gets there, the path of the coffee file has changed to resources/assets/scripts/util/a.js, so gulp-order doesn't find it.
  3. Use gulp-debug to find out what the files look like at a given step. E.g. .pipe(debug()).

(FYI this doesn't have anything to do with gulp-remember.)

Here is one working solution:

'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();

gulp.task('js', function (callback) {

    var coffeeFilter = $.filter(['**/*.coffee']);

    var src = [
        'resources/assets/bower/jquery/dist/jquery.min.js',
        'resources/assets/bower/jquery-migrate/jquery-migrate.min.js',
        'resources/assets/scripts/util/a.*', // don't hard-code .coffee
        'resources/assets/scripts/b.js'
    ];

    var destName = 'scripts.js';
    var dest = 'public/assets';

    return gulp.src(src)

    .pipe(coffeeFilter)
    .pipe($.cached('coffee'))
    .pipe($.coffee())
    .pipe($.remember('coffee'))
    .pipe(coffeeFilter.restore())
    .pipe($.order(src, { base: process.cwd() })) // order after removing coffee filter
    .pipe($.concat(destName))
    .pipe(gulp.dest(dest));
});

from gulp-remember.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.