brunch/brunch-guide

chapter04-starting-from-scratch.md > Split targets

Closed this issue · 5 comments

@tdd : Hi Christophe, I can't seem to be able to have this to work properly:

'libraries.js': /^app\/jquery\.js/
'app.js': /^(?!app\/jquery\.js)/

Running the example code, it creates the app.js but not the libraries.js. The jQuery just gets into app.js. If I replace the libraries' regex by a plain string, then the file gets created. Anything possibly wrong with the regex?

Thanks,

Antoine

tdd commented

Hey Antoine,

Have you tried with the provided repo? Does it work there? (it should, it worked while writing this).

If you're going with your own attempts, can you confirm your JS file is indeed jquery.js, all lowercase?

Cheers,

Provided repo --> Yes, I did. Just to be on the safe side, I just did it once again with identical result (all JS code goes into app.js, libraries.js does not get created).

jquery,js all lowercase

Could being on a Windows machine have any influence?

tdd commented

Ooooooh that's a good point. Slashes / backslashes? God that'd suck. I advise you try with the following settings:

'libraries.js': /^app\\jquery\.js/
'app.js': /^(?!app\\jquery\.js)/

Ça fait la job ! ™

Goddam, j'aurais dû y penser...

Merci !

Antoine

tdd commented

Grmbl. Je vais changer les regex.