Package Exports
- marko-loader
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 (marko-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
marko-loader
A marko template loader for webpack.
Installation
Install required packages:
npm install marko --save
npm install marko-loader --save
And then register the marko loader in your webpack configuration file:
webpack.config.js:
const options = {
// ...
module: {
loaders:[
{ test: /\.marko$/, loader: 'marko-loader' }
]
}
};
module.exports = options;
Usage
With this loader installed, you can then require ./template.marko
files as shown below:
./template.marko:
<div>
<h1>Hello ${data.name}!</h1>
</div>
./index.js:
var template = require('./template.marko')
var html = template.renderToString({ name: 'Frank' });
Additional resources
- Sample app: github.com/marko-js-samples/marko-webpack
License
MIT