{"action":"created","issue":{"url":"https://api.github.com/repos/brunch/brunch/issues/961","labels_url":"https://api.github.com/repos/brunch/brunch/issues/961/labels{/name}","comments_url":"https://api.github.com/repos/brunch/brunch/issues/961/comments","events_url":"https://api.github.com/repos/brunch/brunch/issues/961/events","html_url":"https://github.com/brunch/brunch/issues/961","id":68575778,"number":961,"title":"Exclude packages from concatenating.","user":{"login":"Bartmax","id":3386797,"avatar_url":"https://avatars.githubusercontent.com/u/3386797?v=3","gravatar_id":"","url":"https://api.github.com/users/Bartmax","html_url":"https://github.com/Bartmax","followers_url":"https://api.github.com/users/Bartmax/followers","following_url":"https://api.github.com/users/Bartmax/following{/other_user}","gists_url":"https://api.github.com/users/Bartmax/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartmax/subscriptions","organizations_url":"https://api.github.com/users/Bartmax/orgs","repos_url":"https://api.github.com/users/Bartmax/repos","events_url":"https://api.github.com/users/Bartmax/events{/privacy}","received_events_url":"https://api.github.com/users/Bartmax/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-15T05:11:23Z","updated_at":"2015-04-15T13:41:15Z","closed_at":null,"body":"This is what I want to achieve:\r\n\r\nfrom bower_components, I want to concat all js files into libs.js but I want some 'package' to have it's own file, not concatenated so I can use a cdn with a fallback.\r\n\r\nthis is my working config:\r\n\r\n```\r\n    files:\r\n        javascripts:\r\n          joinTo:\r\n            'scripts/app.js': /^app/\r\n            'scripts/jquery.js': 'bower_components/jquery/**/*.js'\r\n            'scripts/bootstrap.js': 'bower_components/bootstrap/**/*.js'\r\n            'scripts/lib.js': /^(vendor|bower_components)(\\/|\\\\)(?!jquery\\\\|bootstrap\\\\|.*\\.min\\.js)/\r\n```\r\n\r\nthis was confusing and tedious. couldn't be a way that if brunch find the file in the stack it doesn't include it on the others (maybe an option) so I do not need to exclude already added files\r\n\r\nalso ideally, with the ability to ignore the min files, afaik conventions/ignored only works on folders.\r\n\r\nI can't think of a scenario where you want the same file in multiple destinations (but I might be wrong) so that being an option works.\r\n\r\nProposal: \r\n```\r\n    files:\r\n        javascripts:\r\n          exclude: '/**/*.min.js'\r\n          joinOnce: true\r\n          joinTo:\r\n            'scripts/app.js': /^app/\r\n            'scripts/jquery.js': 'bower_components/jquery/**/*.js'\r\n            'scripts/bootstrap.js': 'bower_components/bootstrap/**/*.js'\r\n            'scripts/lib.js': /^(vendor|bower_components)/\r\n```\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/brunch/brunch/issues/comments/93405291","html_url":"https://github.com/brunch/brunch/issues/961#issuecomment-93405291","issue_url":"https://api.github.com/repos/brunch/brunch/issues/961","id":93405291,"user":{"login":"es128","id":1740641,"avatar_url":"https://avatars.githubusercontent.com/u/1740641?v=3","gravatar_id":"","url":"https://api.github.com/users/es128","html_url":"https://github.com/es128","followers_url":"https://api.github.com/users/es128/followers","following_url":"https://api.github.com/users/es128/following{/other_user}","gists_url":"https://api.github.com/users/es128/gists{/gist_id}","starred_url":"https://api.github.com/users/es128/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/es128/subscriptions","organizations_url":"https://api.github.com/users/es128/orgs","repos_url":"https://api.github.com/users/es128/repos","events_url":"https://api.github.com/users/es128/events{/privacy}","received_events_url":"https://api.github.com/users/es128/received_events","type":"User","site_admin":false},"created_at":"2015-04-15T13:41:15Z","updated_at":"2015-04-15T13:41:15Z","body":"> afaik conventions/ignored only works on folders\r\n\r\nNope, it works on any path, and you can use globs, so the thing you're trying to do with `exclude` in your proposal you should be able to do there. Might want to try dropping the leading slash if that's the glob pattern you were trying and having trouble with it.\r\n\r\n> I can't think of a scenario where you want the same file in multiple destinations\r\n\r\nlots of projects want this\r\n\r\nAs you've identified, Brunch currently does not make it easy to have fine-grained control over concatenation. It's possible, but ugly. Ways to make this better have been discussed in #616 and elsewhere, and my intention is to incorporate those sorts of improvements into Brunch 2.0.\r\n\r\nI do like your `joinOnce` suggestion, and will consider including something it or something like it.\r\n\r\nI've also just opened https://github.com/es128/anymatch/issues/6 which should make it easier to do the exclusion pattern you needed for `scripts/lib.js` using an array of matchers with negated glob patterns."}}