Gathering detailed insights and metrics for dwy-mustache-loader
Gathering detailed insights and metrics for dwy-mustache-loader
Gathering detailed insights and metrics for dwy-mustache-loader
Gathering detailed insights and metrics for dwy-mustache-loader
npm install dwy-mustache-loader
Typescript
Module System
Min. Node Version
Node Version
NPM Version
64.9
Supply Chain
92.4
Quality
73.6
Maintenance
50
Vulnerability
99.3
License
JavaScript (98.61%)
HTML (1.39%)
Built with Next.js • Fully responsive • SEO optimized • Open source ready
Total Downloads
1,025
Last Day
2
Last Week
4
Last Month
18
Last Year
111
WTFPL License
1 Stars
53 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Mar 05, 2023
Latest Version
1.2.1
Package Id
dwy-mustache-loader@1.2.1
Size
2.79 kB
NPM Version
5.4.2
Node Version
8.5.0
Cumulative downloads
Total Downloads
Last Day
100%
2
Compared to previous day
Last Week
-60%
4
Compared to previous week
Last Month
157.1%
18
Compared to previous month
Last Year
46.1%
111
Compared to previous year
Compiles Mustache templates with Hogan and optionally html-minifier.
1$ npm i -S dwy-mustache-loader
1module: { 2 loaders: [ { 3 test: /\.html$/, 4 loader: 'dwy-mustache' 5 // loader: 'mustache?minify' 6 // loader: 'mustache?{ minify: { removeComments: false } }' 7 // loader: 'mustache?noShortcut' 8 } ] 9}
1module: { 2 rules: [ { 3 test: /\.html$/, 4 loader: 'dwy-mustache-loader' 5 // loader: 'mustache-loader?minify' 6 // loader: 'mustache-loader?{ minify: { removeComments: false } }' 7 // loader: 'mustache-loader?noShortcut' 8 } ] 9}
1var template = require('./template.html'); 2var html = template({ foo: 'bar' });
If noShortcut
is passed, then Hogan compiled template is returned instead, so
you can pass it as partial.
1var template = require('./template.html'); 2var template2 = require('./template2.html'); 3var html = template.render({ foo: 'bar' }, {partial: template2});
If clientSide
is passed in, then Hogan will not pre-compile the template.
If tiny
is passed in, the source of the template will not be emitted, creating a smaller output.
if render
is passed in, the data is sent is used to immediately render the template.
For example, the following will render index.mustache
with the provided data (title
), which can immediately be used by HtmlWebpackPlugin.
1module: { 2 rules: [ { 3 test: /index\.mustache$/, 4 loader: 'dwy-mustache-loader', 5 options: { 6 tiny: true, 7 render: { 8 title: 'hello world', 9 }, 10 partials:{ 11 header:``, 12 footer:`` 13 } 14 }, 15 } ] 16} 17plugins: [ 18 new HtmlWebpackPlugin({ 19 template: 'index.mustache', 20 inject: 'body', 21 }), 22]
If another loader is chained after Mustache-Loader then the minify
, clientSide
, and tiny
options will be ignored.
Any additional Hogan parameters passed into this loader will be passed through to Hogan.
No vulnerabilities found.