March 13, 2012

how to create makefile in javascript?

Question by Navrattan Bansal

Possible Duplicate:
Make File for Javascript

Actually i am writing some javascript for testing purpose.
i want to use multiple javascripts in which functions are defined.
Is there any way to achieve this ?
I think Make file is the way.
But i don’t know that also.
I want to generate make file.
Can any body suggest me how is to be done?

Answer by Starx

If you looking to combine multiple scripts as one. You can the use build script Boilerplate.

Why to use it? Its not only about scripts.

Combines and minifies javascript (via yui compressor)
Inlines stylesheets specified using @import in your CSS
Combines and minifies CSS
Optimizes JPGs and PNGs (with jpegtran & optipng)
Removes development only code (any remaining console.log files, profiling, test suite)
Basic to aggressive html minification (via htmlcompressor)
Autogenerates a cache manifest file (and links from the html tag) when you enable a property in the project config file.
Revises the file names of your assets so that you can use heavy caching (1 year expires).
Upgrades the .htaccess to use heavier caching
Updates your HTML to reference these new hyper-optimized CSS + JS files
Updates your HTML to use the minified jQuery instead of the development version
Remove unneeded references from HTML (like a root folder favicon)
Runs your JavaScript through a code quality tool (optional)
...

Please fill the form - I will response as fast as I can!