Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hiddentao/weber

Compile scripts, stylesheets and templates on-the-fly for rapid iterations
https://github.com/hiddentao/weber

Last synced: 8 days ago
JSON representation

Compile scripts, stylesheets and templates on-the-fly for rapid iterations

Awesome Lists containing this project

README

        

# Introduction

Weber (a fork of [Hem](https://github.com/maccman/hem)) compiles, concatenates and minifies scripts, stylesheets and templates **on-the-fly**.

Weber improves upon Hem by providing more flexibility in terms of input sources and multiple build targets. If Hem
is good enough for you then stick with it. Otherwise take a look at what Weber can offer you below.

# Installation

npm install -g weber

# Usage

Weber runs in 3 modes. Let's look at the **server** mode first...

## Server mode

Once you have Weber configured you can launch server mode by typing the following in the root of your project:

$ weber server

This will launch a simple [Strata](http://stratajs.org/) server running on **http://localhost:9294**.
This mode allows you to quickly test out your scripts, stylesheets and templates and rapidly iterate with them.

But let's configure Weber first. Goto the root of your project folder and type:

$ weber init

You will now find a file called `weber.json`:

{
"/" : "./public_assets",

"/css/app.css" : [
"./css/reset.css",
"./css/main.styl"
],

"/css/test.css" : {
"minify": false,
"input" : [
"./css/test"
]
},

"/js/app.js" : {
"build" : "./app.js",
"input" : {
"dependency" : [ "es5-shimify" ],
"lib" : [ "./lib/jquery.js" ],
"module": [ "./coffee" ]
}
},

"/js/test.js" : {
"minify": false,
"input": [
"./test/testbase.js",
"./test/test.coffee"
]
}
}

The above configuration is put there by Weber just to show you what configuration options are available.

The first key-value pair tells Weber which folder to use as the document root when running in server mode. In
this case Weber will expect an `index.html` file inside the `./public_assets` folder to serve up when the browser
navigates to **http://localhost:9294**. If this setting is ommitted then Weber will assume the document root to be the
folder containing `weber.json`. By the way, Weber can be told to listen on a different port by adding a
`port: