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.
To use as a module:
npm install moonboots-static --save
Or to use it as a global CLI:
npm install moonboots-static -g
var Moonboots = ;var moonboots =moonboots:main: __dirname + '/app/app.js'// Contents from the public directory// will be copied to the target directorypublic: __dirname + '/public'// Directory to build files intodirectory: __dirname + '/_build'// Log build itemsverbose: true;moonboots;
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.
--quiet Turn off any logging. It is on by default.
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
directory: The directory where you want to write your files.
public: A directory where the contents will be
cp -r'd into the
directoryafter 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
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
errit will be the first argumentt. If this
cbis not provided,
moonboots-staticwill emit a
moonboots: This is an object that is passed directly to Moonboots. See the documentation for what options are available.
npm start to see what files are built to
sample/_build using the
sample/config.js config file.