I understand how brunch handles javascript files, combining them into individual output files:
files:
javascripts:
joinTo:
'javascripts/app.js': /^app/
'javascripts/vendor.js': /^vendor/
'test/javascripts/test.js': /^test(\/|\\)(?!vendor)/
'test/javascripts/test-vendor.js': /^test(\/|\\)(?=vendor)/
the 2nd line, for example, takes all the javascript files in the /vendor/ folder and makes the vendor.js
The Regex (/^vendor/) specifies a folder path correct? Any way to have the regex apply to the file names as well? For example if there was a jquery.js and a jquery.min.js, I just want the jquery.js file included. Is this possible?
You can use functions to test against paths. With them stuff should be simple:
joinTo:
'javascripts/vendor.js': (path) ->
/^vendor/.test(path) and not /\.min\.js$/.test(path)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With