Fork me on GitHub
Ignitersworld Lab

Node Build Script

Boilerplate to use node.js as a build script for web projects.

Node Website Build Script

Here I present a build tool script boilerplate created on top of node.js .
While working on lot of web projects I had some specific needs like, concatenation, minfication and obfuscation of JS files, reusing html content like header, footer, menu etc which is not possible without any server scripting (as we don't have any include on html). Templating and CSS preprocessing also helps a lot.
In most of my projects I as using restful services for communicating with server, so I didn't wanted any server language in my frontend code. There are lot of framework and build tools are available, but either my projects were too small to be on a framework or framework provide too much which I don't need.
So I decided to use node.js to fulfill all my needs for small projects and independent frontend projects which must serve following things.

  1. Concatenation of JS files.
  2. Minfication and obfuscation of JS files.
  3. Includes to have reusable HTML.
  4. CSS prepossessing (with LESS).
  5. Templating (With Handlebars).
  6. Output file should be independent of build script (Plain HTML, CSS and JS) , which is ready to deploy.

You may like to see about node.js, less, handlebars, as we are using them on our build script.
http://nodejs.org/api/
http://www.lesscss.org/
http://handlebarsjs.com/

To start using this boilerplate copy whole folder and start changing each files as your need. You can seperate you working and build directory outside.

After you can go to node project folder through command line and start build process with

node build

We will see how we can use this boilerplate to create our build script.

Files

Utilities files

Want to support and contribute to Node Build Script?

Node Build Script needs your contribution to become best of its kind. There are lot of things you can do to contribute and support plugin.

Author

This plugin is developed and maintained by me ( Sudhanshu Yadav ignitersworld.com/me ) . If you have any query you can contact me at sudhanshuyadav2@gmail.com.

You can also follow me on twitter and github Follow @s-yadav .

Check out my other open source work