WOW is a Convention Over Configuration task runner using Node.
just install the plugins and it compiles, minimizes, concatenates, etc.
Comes with watch and reload included.
Every compiled file has its source map.
npm install -g wow-task-runner
there are modules ready for many useful tasks
npm install -g wow-uglify-js wow-clean-css
In this mode WOW will listen for changes, and compile a file if it's source or one of the included files is modified.
By default WOW loads all modules named wow-* present in the local or in the global scope.
If you want to compile all the files matching a specific module run WOW with the names of the modules you've chosen.
e.g. this minimizes all the .js and .css in the current folder and subfolders.
wow uglify-js clean-css
A module can also expose tasks as functions, and they can be called this way:
e.g. if a module called wow-foo exports a function named bar
wow foo.bar.conf1 foo.bar.conf2=2
will call foo.bar with
if foo.run is exported, it will be called with argument:
before calling foo.bar
As promised, configuration comes at last. But sometimes it's needed.
This is a minimal wowfile.js
var conf ="modules": "uglify-js""clean-css""less""sass"moduleexportsdefault = conf;
here is another one:
var prod ="modules": "uglify-js""clean-css""less""sass""coffee-script""typescript""html-minifier""concat""less":"globalVars": "base": """wow":"minimize": false"wow":"keepIntermediate": truevar test ="modules":"less""sass""coffee-script""typescript""html-minifier""concat""less":"globalVars": "base": """wow":"minimize": true"wow":"minimize": falsemoduleexportsdefault = prod;moduleexportstest = test;
As you may have noticed, where are multiple environments, the default is called, of course default and is selected if no environment is specified.
You can select a specific environment by launching WOW with the env argument, e.g.
This attribute contains a list of the modules that need to be loaded.
Each name will be prefixed with wow- when searching.
Type: list of strings containing regular expressions. If this attribute is defined, only files matching these regular expression are compiled. Except if they match a regular expression in the blacklist.
type: list of strings containing regular expressions. default: all paths containing /include/ or \include\.If this attribute is defined, files matching these regular expression are ignored when modified.
This is an object containing configuration that is common to all modules, and each modules can look here to initialize its behavior accordingly. This attributes can also be passed only to some specific modules by adding the wow object to the configuration of those modules, see below.
default: true. If set to false every module that does minimization of the source must NOT do it, if it's possible.
Module configuration is specified in the dictionary, setting an object with the name of the module as key. Its contents are passed directly to the configuration of the wrapped functionality. For example for less, the object is passed to less.render. If is needed to overwrite the configuration of the wow modules, as the common configuration parameters or some other parameters specific of the module, they must be given wrapped inside an object with key wow, as passed for the less module in the example above.