Configures the default lasso instance using the provided config
. The config
can either be an object or a path to a JSON file.
Creates a new configured Lasso instance.
Returns the default Lasso instance.
Equivalent to require('lasso').getDefaultLasso().lassoPage(options, callback)
. See Lasso » lassoPage below.
Equivalent to require('lasso').getDefaultLasso().lassoResource(options, callback)
. See Lasso » lassoResource below.
Express middleware to serve up static files generated by Lasso.js.
Example usage:
app.use(require('lasso/middleware').serveStatic());
- Supported options:
- lasso - The configured lasso instance (defaults to
require('lasso').getDefaultLasso()
) - sendOptions - Options passed to the send module that is used to serve up static assets
- lasso - The configured lasso instance (defaults to
See ./lib/Config.js
Processes all of the dependencies for a page to produce a set of static JS and CSS bundles, as well as any other static assets.
The result will be a LassoPageResult instance that provides the list of generated URLs for all of the static bundles, as well as a list of the generated files.
Supported options:
- dependencies - An array of dependencies
- from - The base directory for calculating relative paths (optional)
- packagePath - A path to a
browser.json
file - packagePaths - An array of paths to
browser.json
files
The loaded Config config instance
Short-hand for lassoPageResult.getHtmlForSlot('body')
.
Returns an array of all of file paths for all of the generated JavaScript bundles
Returns an array of all of URLs for all of the generated CSS bundles
Short-hand for lassoPageResult.getHtmlForSlot('head')
.
Returns the HTML markup for each slot. The returned object will be an object. For each property of the returned object, the name will be the slot name (e.g. head
) and the value will be the HTML markup (e.g. <link rel="stylesheet" type="text/css" href="static/style.less.css">
).
Example usage:
var headHtml = lassoPageResult.getHtmlForSlot('head');
var bodyHtml = lassoPageResult.getHtmlForSlot('body');
Returns an array of all of file paths for all of the generated JavaScript bundles
Returns an array of all of URLs for all of the generated JavaScript bundles
Returns an array of all of file paths for all of the generated files