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

consistent concat order #25

Closed
chmontgomery opened this issue Aug 25, 2014 · 5 comments
Closed

consistent concat order #25

chmontgomery opened this issue Aug 25, 2014 · 5 comments
Milestone

Comments

@chmontgomery
Copy link
Contributor

Right now, custom transforms can cause the files in stream to stream through in a seaminly random order. Perhaps use something like gulp-order to make this deterministic: https://www.npmjs.org/package/gulp-order

@chmontgomery chmontgomery added this to the Ice Box milestone Aug 25, 2014
@RyanS
Copy link

RyanS commented Jan 13, 2015

This would def be good to have. Was trying this out and included gulp-hogan to precompile mustache templates. No matter what I did the compiled templates were at the bottom of the file which was problematic

@timelf123
Copy link

Every time my js bundles are built the script load order changes. Sometimes this causes errors and causes the app to fail

@chmontgomery
Copy link
Contributor Author

Thinking through the config that would represent this feature... what do people think about this?:

// bundle.config.js
header: {
    scripts: [
        {
            src: './bower_components/jquery/dist/jquery.js',
            minSrc: './bower_components/jquery/dist/jquery.min.js'
        },
        './vendor/*.js',
        './content/*.coffee',
        './content/*.js'
    ],
    styles: [
        //...
    ],
    options: {
        order: {
            scripts: [
                'always-first.js',  // from /content/*.js
                'jquery*.js',       // depending on env, this could be streaming min or non-min file so use wildcard
                'lodash.js',        // from /vendor 
                'file1.js',         // compiled from file1.coffee
                'file2.js',         // compiled from file2.coffee
                '!always-last.js',  // everything else except always-last.js
                'always-last.js'    // from /content/*.js
            ],
            styles: [
                //...
            ]
        }
    }
}

The config is based off what gulp-order natively supports.

@timelf123
Copy link

That looks great to me. Pretty easy to understand too

@chmontgomery
Copy link
Contributor Author

@RyanS @timelf123 can you pull down v2.22.0 and verify if this feature works for you? Thanks!

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

No branches or pull requests

3 participants