-
Notifications
You must be signed in to change notification settings - Fork 436
vendor files concatenated to output file last #1527
Comments
I believe this is true. The lines here seem to be flipped - if I understand the docs correctly,
|
Implements the change described in my comment on brunch#1527 at brunch#1527 (comment)
This seems to still be the case as of d6b6577 ( brunch/lib/fs_utils/generate.js Lines 108 to 112 in d6b6577
Any thoughts from the maintainers? Thanks again for this tool, which has been serving me well for several years now! |
I'll debug this ASAP and see what can be fixed! |
Thank you! If it helps, I just brought my branch at https://github.com/cxw42/brunch/tree/1527 up to date with master. That branch actually permits putting vendor files both before and after wrapped files. I believe the fix is easy, but figuring out whether it will break existing clients may be harder :) . |
Description
The documentation for 'files' here - http://brunch.io/docs/config#files states that files from vendor folder will be compiled first by default. The docs there also state the 'order' property can be used to configure the compilation order.
In previous/old versions of brunch (< v1.8) the app.js would have the js-yaml.js file at the top, followed by the compiled modules in app/. This is what the docs suggest should happen by default.
Since upgrading my project to 2.8 the app/ modules are always at the top of the app.js. This would appear contrary to the docs.
I have traced the code in brunch and i feel like when the files array is split in to 'moduleFiles' and 'nonModulesFiles' in lib/fs_utils/generate.js#concat for processing that the order of the files is lost.
I see this split is done likely so that deppack can be run on the moduleFiles only, but feel like it breaks the ordering?
Test case: https://github.com/3000/brunch-order
Expected behavior
The vendor/js-yaml.js should be the first js processed and written to the top of app.js file.
The app.js file should have the app/.*coffee files appended to the end of app.js below the vendor file(s).
Actual behavior
vendor/js-yaml.js is always written last to the file, regardless of the stated defaults and order in the config.
I believe this is because generateModuleFiles writes the files always before nonModuleFiles in #basicGenerate
Environment
package.json
contentsbrunch config contents
Other useful files, when present (log,
bower.json
etc.)Used to order as expected in brunch 1.8. Since upgrading to 2.8 this order is not as expected.
Debug output from brunch indicates that the files will be concatenated in the correct order:
The text was updated successfully, but these errors were encountered: