Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chrisdothtml/rollup-plugin-dustjs

A rollup plugin for importing dustjs templates as modules
https://github.com/chrisdothtml/rollup-plugin-dustjs

dustjs rollup rollup-plugin yarn

Last synced: about 2 months ago
JSON representation

A rollup plugin for importing dustjs templates as modules

Awesome Lists containing this project

README

        

# rollup-plugin-dustjs

> A [rollup](https://github.com/rollup/rollup) plugin for importing dustjs templates as modules

## Install

```bash
yarn add --dev rollup-plugin-dustjs

# npm works too
npm install --save-dev rollup-plugin-dustjs
```

**rollup.config.js**

```javascript
import dustjs from 'rollup-plugin-dustjs'

export default {
// ...
plugins: [
dustjs()
]
}
```

### Options

#### whitespace

Preserves whitespace in templates

Type: `Boolean`

Default: `false`

## Use

### Import

```javascript
import main from './main.dust'
import { render } from 'dustjs-linkedin'

render(main, {}, (error, output) => {
// ...
})
```

### Partials

**main.dust**

```


{>"./heading.dust"/}

...



```

**heading.dust**

```

My heading


```

## License

[MIT](LICENSE)