Building An Assets Subdirectory When Using Brunch

Brunch has an opinion about the app/assets/ directory that it generates as part of an app skeleton. It simply copies these files over to the deployment directory, w/o running them through any minification.

But let’s say I want to build a standalone page under the assets/ directory, maybe for a signup form for my website (which I don’t really feel like making into a Backbone View). This form could share the vendor/ minified files, but would not have a need for the app.js or app.css files.

By default, Brunch wouldn’t process those files, as they would be somewhere under, say, app/assets/signup.

Here’s a custom config_signup.coffee file that builds files in the assets/signup/ directory and copies them where I expect. It would be pretty sweet if this could be somehow chained onto the main CoffeeScript file.

Now when I run brunch build -c config_signup.coffee –minify, I can get the same processing on this particular subset of the site.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.