
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
grunt-dustin
Advanced tools
Better templating with LinkedIn's dust fork.
Boolean
This tells the task to render templates.
String
Passed to the adapter as the resolve option.
Boolean
Same as adapter option.
String
"test/data/*.json"
Passed to the adapter as the data option.
String
"test/helpers/*.js"
Register helpers for the render context. Passed to the adapter as the helpers option.
Boolean
Propagates to the adapter cache option.
Boolean
This tells the target to compile templates.
String
Passed to the adapter as the resolve option.
Boolean
Same as for rendering.
Boolean
This tells the target to concatenate files into the dest file. See the Grunt task config example for details.
String
"test/out/js/"
Copy client side libraries to this folder. If this option is set, rendering and compiling is ignored.
String
"js/"
The client side script will prefix partial paths with this to load them.
This:
{>"some/partial"/}
will resolve to this template: js/some/partial.js
.
String
"test/helpers/client/*.js"
If set, the client scripts will include these helpers.
Example helper file:
dust.helpers.hello = function ( chunk, context, bodies, params ){
return chunk.write("hello ")
}
Boolean
Include dustin helpers to client side.
You can see what helpers are available on the client side in the module dir lib/client/helpers
.
Boolean
Include the dustjs helpers to client side.
grunt.initConfig({
dustin: {
// set global values for path resolution
options: {
// this prefixes partial lookup to shorten referencing
resolve: "test/",
setup: function( adapter, dust ){
// whatever you want to do with dust before anything happens,
// do it here
}
},
copyClientLibs: {
options: {
// if the client option is present, every other is ignored
// and client side libraries are copied to this dir
copy: "test/out/js/",
// set path resolution to client template loading
// templates will attempt to load from this dir
// example: {>"elements/message"/}
// will load from template/elements/message.js
resolve: "template/",
helpers: "test/helpers/client/*.js",
dustinHelpers: true,
dustHelpers: true
}
},
render: {
options: {
// this target renders html files
render: true,
// Dust removes white space by default. Don't do that now.
preserveWhiteSpace: true,
// create a global context from these json files
// file names will be global properties
data: "test/data/*.json",
// execute these js files and let them register helpers
helpers: "test/helpers/node/*.js",
// this keeps the cache clear
cache: false
},
expand: true,
cwd: "test/page",
src: "*.dust",
dest: "test/out/",
ext: ".html"
},
compile: {
options: {
// this target compiles js files
compile: true,
// we don't care about white space in compiled templates
preserveWhiteSpace: false
},
expand: true,
cwd: "test/",
src: "elements/*.dust",
dest: "test/out/template/",
ext: ".js"
},
compileAndConcat: {
options: {
preserveWhiteSpace: false,
compile: true,
// this one concats compiled files into one
concat: true
},
files: {
"test/out/template/elements.js": "test/elements/*.dust"
}
}
}
})
MIT
FAQs
Grunt task for LinkedIn's Dust fork
The npm package grunt-dustin receives a total of 0 weekly downloads. As such, grunt-dustin popularity was classified as not popular.
We found that grunt-dustin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.