0.1.3 • Published 11 years ago

connect-compiler v0.1.3

Weekly downloads
10
License
-
Repository
github
Last release
11 years ago

connect-compiler

connect middleware for dynamically recompiling derived files at serve-time. This module is designed for speeding up development; best-practices would have you compile all necessary files as part of your production deploy process. But you knew that, of course.

Usage is the same as all other connect middleware:

    var connect  = require('connect')
    ,   compiler = require('connect-compiler')
    
    ,   server = connect.createServer(
            connect.logger(),
            compiler({
                src     : 'src'
                dest    : 'var'
                enabled : [ 'coffee', 'uglify' ]
            }),
            connect.static(__dirname + '/public'),
            connect.static(__dirname + '/var')
        )
    ;
    
    server.listen(6969);

Of note, earlier versions of connect actually came with a module like this, but they do not any longer.

Settings

The compiler middleware takes a settings object, minimally containing a list of compilers to enable (enabled). Most uses will also specify a source directory (src).

Compilers

To enable a compiler, you specify its id, which you can get from the handy list that follows. Some compilers take options, which you pass using the options setting using the compiler id as the key.

For example, to disable the bare option for the CoffeeScript compiler, you'd do something like:

server = connect.createServer(
    compiler({
        src     : 'src'
        dest    : 'var'
        enabled : [ 'coffee' ],
        options : {
            'coffee' : {
                'bare' : false
            }
        }
    }),
    connect.static(__dirname + '/public'),
    connect.static(__dirname + '/var')
)

Compiler IDs

Feedback

Find a bug or want to contribute? Open a ticket on github. You're also welcome to send me email at dsc@less.ly.

If you're interested in contributing, note that at the moment, a version of node-seq is checked in under node_modules while we wait for a pull request to be pulled into master.

0.1.3

11 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago