Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/chrisdothtml/rollup-plugin-dustjs
- Owner: chrisdothtml
- License: mit
- Created: 2017-03-22T06:50:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-25T08:48:28.000Z (over 7 years ago)
- Last Synced: 2024-10-08T07:51:05.538Z (2 months ago)
- Topics: dustjs, rollup, rollup-plugin, yarn
- Language: JavaScript
- Homepage: https://npm.im/rollup-plugin-dustjs
- Size: 52.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome - dustjs - Import Dust.js templates. (Plugins / Templating)
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)