I use https://npmjs.org/package/grunt-dust for pre-compiling dust templates with partials.
The relevant part of Gruntfile.js
can look something like this:
dust: {
defaults: {
files: {
'views/index.js': 'views/**/*.dust'
},
options: {
wrapper: 'commonjs',
runtime: false,
wrapperOptions: {
returning: 'dust',
deps: {
dust: 'dustjs-linkedin',
dustHelpers: 'dustjs-helpers'
}
}
}
}
},
This will put all of the compiled dust templates in a views/index.js
.
There are more examples and more detailed docs at https://github.com/vtsvang/grunt-dust