
Product
Announcing Bun and vlt Support in Socket
Bringing supply chain security to the next generation of JavaScript package managers
grunt-batman-template
Advanced tools
forked from grunt-template-client package
Compile any and all templates into a ready to use script include.
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-batman-template
Then add this line to your project's grunt.js gruntfile:
grunt.loadNpmTasks('grunt-batman-template');
given the following config and template
batman: {
dist: {
src: ['templates/**/*.html'],
dest: 'dist/tmpl.js'
}
}
<h1 data-bind="date"></h1>
<h2 data-bind="time"></h2>
<h1 class="title" data-bind="title"></h1>
<h2 class="value" data-bind="current | prettyNumber | prepend prefix"></h2>
<p class="more-info" data-bind="moreinfo"></p>
will output the following script file
(function bundleTemplates() {
Batman.View.store.set("graph", '<h1 class="title" data-bind="title"></h1><h2 class="value" data-bind="current | prettyNumber | prepend prefix"></h2><p class="more-info" data-bind="moreinfo"></p>' );
Batman.View.store.set("clock", '<h1 data-bind="date"></h1><h2 data-bind="time"></h2>' );
}());
ready to use/include/concat etc.
I guess there will be need to tweek the regex that cleans the template.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Copyright (c) 2012 Florian Traverse Licensed under the MIT license.
FAQs
compiles any and all templates into ready to use includes
We found that grunt-batman-template 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.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.