Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

brunch config: javascript files exclude *.min.js files

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?

like image 694
Bryce Fischer Avatar asked Dec 31 '25 13:12

Bryce Fischer


1 Answers

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)
like image 178
Paul Miller Avatar answered Jan 02 '26 02:01

Paul Miller