File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed
Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change 1+ # rollup-plugin-dustjs
2+
3+ > A rollup plugin for importing dustjs templates as modules
4+
5+ ## Install
6+
7+ ``` bash
8+ yarn add --dev rollup-plugin-dustjs
9+
10+ # npm works too
11+ npm install --save-dev rollup-plugin-dustjs
12+ ```
13+
14+ ** rollup.config.js**
15+
16+ ``` javascript
17+ import dustjs from ' rollup-plugin-dustjs'
18+
19+ export default {
20+ // ...
21+ plugins: [
22+ dustjs ()
23+ ]
24+ }
25+ ```
26+
27+ ### Options
28+
29+ #### whitespace
30+
31+ Default: ` false `
32+
33+ Type: ` Boolean `
34+
35+ ## Use
36+
37+ ### Import
38+
39+ ``` javascript
40+ import main from ' ./main.dust'
41+ import { render } from ' dustjs-linkedin'
42+
43+ render (main, {}, (error , output ) => {
44+ // ...
45+ })
46+ ```
47+
48+ ### Partials
49+
50+ ** main.dust**
51+
52+ ```
53+ <div class="box">
54+ {>"./heading.dust"/}
55+ <p>...</p>
56+ </div>
57+ ```
58+
59+ ** heading.dust**
60+
61+ ```
62+ <h1>My heading</h1>
63+ ```
You can’t perform that action at this time.
0 commit comments