![]() ![]() ![]() I’m sure there are other amazing features and plugins that I should be using and could make the list. ![]() But for everything else, it’s add and forget, which is exactly how it should be. jQuery) are specified as such in the configuration. The only thing I have to do is make sure that libraries that need to load first (e.g. Need to add a new library? Just drop it in the /scripts/vendor folder and it gets loaded by your site! Don’t need it anymore? Delete it from the folder! I no longer have to deal with listing every javascript library I’m using in my HTML files. While the goal is to reduce the number of requests made from the browser to the server, the real benefit is that I can easily create my HTML file to load these 4 files, and then never worry about my vendor scripts again. I usually have the following: app.js, app.css, vendor.js, vendor.css. This is pure gold: Brunch can combine multiple JavaScript and CSS files together into a single file, or set of files, per the configuration. Of course, you could download the underlying tools and run them directly, but Brunch just has it built in and integrated.īrunch build -optimize JavaScript/CSS Combining It can even recompile your files as you edit them, with minification. Brunch has a mode to minify Javascript and CSS, so I use that whenever I’m doing a production build. I never knew I wanted this, but it’s pretty nice. This saves me the trouble to set up IIS or Tomcat on my dev boxes.īrunch watch -server Automatic Minification It also has a built-in Express web server that serves the files over HTTP. It makes it transparent to use Jade or CoffeeScript, since I never have to worry about whether or not it is compiled. I am usually using this mode while developing, since it shortens the inevitable cycle of edit-save-reload. Watch Mode and Serverīrunch can watch your files and rebuild each file as it changes. This has reduced the number of moving parts (or at least shuffled them into other areas, e.g. Brunch puts the entire site in a single folder after compilation. Once it’s compiled, I can actually go look at the JavaScript to ensure it is correct, and debug it.ĭeployment is now just a matter of copying these compiled assets. Brunch automatically converts these into HTML, JavaScript, and CSS for me every time I save. I could easily switch to Stylus or Sass or another wrapper for CSS with a new plugin. With Brunch, I’m now writing in Jade, CoffeeScript, and Less. This was amazing to me at the time, but it was really just the tip of the iceberg. In one project, I figured out how to install some nuget packages that compiled Less into CSS at runtime. I did have a build system for my websites before-it was just baked into Visual Studio. So here they are: why Brunch makes my life easier. I attempted to convey these points to a coworker recently, to convince him to use Brunch, but I regret that they didn’t come out as coherently at the time. In this post, however, I want to lay out a few reasons why I’m using Brunch and how it’s benefiting me. In that post, I wrote about switching from ASP.NET to Brunch. I wrote earlier about Brunch, which I have adopted recently for managing my web site projects. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |