Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Scripts not in order #7

Closed
skimberk1 opened this Issue · 2 comments

2 participants

@skimberk1

I'm adding scripts (using addJs()) to my namespace, but in the compacted file, the order isn't maintained. Example:

compact.addNamespace('edit');
compact.ns.edit
    .addJs('ace/ace.js')
    .addJs('ace/mode-html.js')
    .addJs('ace/mode-css.js')
    .addJs('ace/mode-javascript.js')
    .addJs('edit.js');

The scripts are added to the compacted file in this order: mode-html.js -> mode-css.js -> mode-javascripts.js -> edit.js -> ace.js

I was wondering if there is any way to fix this? Thanks.

@serby
Owner

I think I've found the cause of your problem. I have been calling: async.concat to join the files together. When all the files are small they get concatenated in the correct order. As soon as they are large and vary in size the order is not deterministic.

I've switched to using async.concatSeries which will fix this problem. I'm just making the regression tests and will have a new version of the module published in NPM in the next 30 mins.

Thanks for using compact and taking the time to report the bug.

@serby
Owner

This is now published to NPM as version 0.0.4

@serby serby closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.