JSPM

  • Created
  • Published
  • Downloads 681
  • Score
    100M100P100Q109296F
  • License MIT

Lasso.js plugin to support compilation of Marko templates

Package Exports

  • lasso-marko
  • lasso-marko/lasso-marko-plugin.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lasso-marko) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

lasso-marko

NOTE: lasso-marko@4 requires marko >= 5, @marko/compiler >= 5.33 and lasso >= 3. For older versions use lasso-marko@3.

Plugin for the Lasso.js to support compilation and transport of Marko template files. Templates are compiled using the Marko compiler that produces a CommonJS module as output.

Usage

npm install lasso-marko --save

Register the plugin when configuring the lasso. For example:

require('lasso').configure({
    "plugins": [
        ...
        "lasso-marko"
    ]
    ...
});

Required Marko templates will automatically be found via static code analysis when loaded, eg like:

var template = require('./template.marko');

template.render({
        name: 'Frank'
    },
    function(err, output) {
        console.log(output);
    });

To explicitly declare templates that may not be discovered via static code analysis of CommonJS modules, you can also choose to declare Marko template dependencies in an browser.json file.

{
    "dependencies": [
        "marko-dependencies: ./template.marko"
    ]
}

Contributors

Contribute

Pull Requests welcome. Please submit Github issues for any feature enhancements, bugs or documentation problems.

License

Apache License v2.0