# dust-named-loader

> dustjs loader module for webpack, with support for naming the template

Latest version **1.0.0** (published 2015-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install dust-named-loader
pnpm add dust-named-loader
yarn add dust-named-loader
bun add dust-named-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-07-10 |
| First published | 2015-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jordan Gensler |
| Maintainers | jordangens |

## Links

- npm: https://www.npmjs.com/package/dust-named-loader
- npm.io page: https://npm.io/package/dust-named-loader

## Dependencies (2)

- [loader-utils](https://npm.io/package/loader-utils.md) ^0.2.10
- [dustjs-linkedin](https://npm.io/package/dustjs-linkedin.md) *

## Recent versions

- 1.0.0 (latest) — 2015-07-10

## README

# [dust](https://github.com/linkedin/dustjs) loader for [webpack](http://webpack.github.io/) (with names)

Compiles dust templates and exports the compiled functions, allowing for rendering of the templates in a browser environment.

## Usage

[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)

``` javascript
var template = require("dust-named-loader!./file.dust");
// => returns file.dust compiled as template function
```

### Recommended config

``` javascript
module.exports = {
  module: {
    loaders: [
      { test: /\.dust$/, loader: "dust-loader" }
    ]
  }
};
```

Then you only need to write: `require("./file.dust")`

### Rendering a template

You will need to bundle the [dust core](https://github.com/linkedin/dustjs/blob/master/dist/dust-core.js) in your pack in order to render the compiled templates.

```javascript
require('dust-named-loader?name=myTemplate!./views/foo/bar.tpl');

dust.render('myTemplate', context, function(err, result){
	// result holds the rendered HTML code
});
```

## License

MIT (http://www.opensource.org/licenses/mit-license.php)

---
_Source: https://npm.io/package/dust-named-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
