Front end compiler
A simple, unopinionated asset pipline / static site generator / whatever.
I use it for my blog.
$ = require('jquery')(really)
My favorite tools for making web sites are Markdown, CoffeeScript, HAML, and LESS. For the most part, I just want all the things compiled and spit out into a folder I can serve statically. This does that, and just that. If you need more, you're a programmer, and this tool will support you without getting in your way.
Convention or configuration? I like a healthy combination of sensible defaults and flexible configuration options.
npm install -g fec bower
Browse to localhost:8080 to see the default site. Hack away.
The tool works on directories of scripts, styles, templates, and markdown files.
You may create any directory structure you'd like; but
are reserved by the system.
mainScriptis compiled (
fe.coffeeby default). Anything you want in the compiled JS must be required from this file. (This behavior
requireanything you install with
bower, or local scripts
this) is extended with some useful properties:
@page- this page's metadata
@page.html- this page's rendered content
@site- the other pages' metadata
title: the page's title
slug: the filename of the compiled file (defaults to slugified title)
template: a template to wrap the content (optional; output will still be rendered by the main template)
The tool accepts some options. Run
fec help to see the defaults.
require('package-installed-with-bower')from your front-end code. If you have your
bower_componentssomewhere non-standard (i.e. not
project-root/bower_components) specify it here.
--srcDir, -sThe directory your front-end source (coffee/less/md) lives
--buildDir, -bThe directory your compiled, static site lives
--tmpDirA temporary directory for compilation artifacts, safe to delete at any time
--mainScript, -mThe name of your main coffeescript file
--mainTemplateThe name of your main template (hamlc) file
--mainStylesheetThe name of your main stylesheet file
--cssPreprocessorThe preprocessor you'd like to use. Currently supported: less, sass
--compressTrue to uglify/compress your js/css output
--verbose, -vEnable debugging output. Specify more v's for more output.
--quiet, -qDisable all output
.fe file in your project root to override the default for any option. We'll
auto detect the format of your file (json, yaml, and dotfile format are supported).
Be sure to use camelCased, long-option-form of the options. Run
fec help to
see your settings; it will reflect the settings from your