lukekarrys/moonboots-static lukekarrys/moonboots-static


A static build plugin for moonboots.

Host: GitHub

License: MIT

Language: JavaScript

Keywords: moonboots, static


moonboots-static

NPM Build Status

A static build plugin for moonboots.

Just like Moonboots but it will put all the built files into a directory ready to be served statically.

Install

To use as a module: npm install moonboots-static --save

Or to use it as a global CLI: npm install moonboots-static -g

Module Usage

var Moonboots = require('moonboots-static');

var moonboots = new Moonboots({
    moonboots: {
        main: __dirname + '/app/app.js'
    },
    // Contents from the public directory
    // will be copied to the target directory 
    public: __dirname + '/public',
    // Directory to build files into
    directory: __dirname + '/_build',
    // Log build items
    verbose: true
});

moonboots.on('ready', function (err) {
    if (err) {
        // Oh no something went wrong
    } else {
        // Yay, we built our files!
    }
});

CLI Usage

To use it from the command line, provide a path to a config file as the first argument. The config file can be a .json file or a .js file that exports either an object or function that returns an object.

moonboots config.js

--quiet Turn off any logging. It is on by default.

API

  • verbose: Whether you want to log everything. Defaults to false. Even if you don't turn this on you can still listen to the emitted log events with .on('log').
  • directory: The directory where you want to write your files.
  • public: A directory where the contents will be cp -r'd into the directory after everything else is built.
  • htmlSource: A function with the signature (context) that should return the HTML you wish to write to your HTML file. It will have resourcePrefix, cssFileName, and jsFileName set on context. By default this will just use the default Moonboots HTML source.
  • cb: A callback that will be run after the build is complete. If there is an err it will be the first argumentt. If this cb is not provided, moonboots-static will emit a ready event instead.
  • moonboots: This is an object that is passed directly to Moonboots. See the documentation for what options are available.

Test

Run npm test.

Sample

Run npm start to see what files are built to sample/_build using the sample/config.js config file.

License

MIT


Dependencies

package.json
Kind Requirements Latest Stable Latest Release Licenses
async runtime ^1.5.2 2.1.5 2.1.5 MIT
code development ^2.1.0 4.0.0 4.0.0 BSD-3-Clause
colors runtime ^1.1.2 1.1.2 1.1.2 MIT
jshint development ^2.9.1 2.9.4 2.9.4 JSON
lab development ^8.0.2 11.2.1 11.2.1 BSD-3-Clause
mkdirp runtime ^0.5.1 0.5.1 0.5.1 MIT
moonboots runtime ^4.0.1 5.0.1 5.0.1 MIT
ncp runtime ^2.0.0 2.0.0 2.0.0 MIT
precommit-hook development ^3.0.0 3.0.0 3.0.0 MIT
rimraf runtime ^2.5.0 2.6.0 2.6.0 ISC
underscore development ^1.8.3 1.8.3 1.8.3 MIT

Project Statistics

Sourcerank 4
Size 101 KB
Stars 9
Forks 3
Watchers 1
Open issues 0
Dependencies 11
Contributors 3
Tags 8
Created
Last updated
Last pushed

Top Contributors See all

Luke Karrys Garrett Nay Ben Westrate

Projects Referencing this Repo

moonboots-static 2.0.1
A static build plugin for moonboots.
npm - JavaScript - MIT - Updated - 9 stars

Tags See all

  • v2.0.1 - January 19, 2016 19:46
  • v2.0.0 - March 03, 2015 21:44
  • v1.2.1 - February 26, 2015 00:44
  • v1.2.0 - January 14, 2015 23:09
  • v1.1.0 - September 12, 2014 19:21
  • v1.0.2 - September 01, 2014 22:09
  • v1.0.1 - August 12, 2014 23:46
  • v1.0.0 - August 02, 2014 20:46

Something wrong with this page? Make a suggestion

Last synced: 2016-05-27 16:07:47 UTC