Open TimothyGu opened 8 years ago
Here is another loader pug-html-loader, but it works differently
For example, chaining like ng-cache!pug-html
doesn't works with Willyelm's loader,
but with this loader all is ok:
{
test: /\.pug$/,
loader: 'ng-cache!jade-html'
}
Need only remove jade
from peerDependencies
@iboozyvoozy
you can use pug-html
with ngtemplate
.
pug-html
returns module.exports = "your_html"
but not the HTML string itself.
ngtemplate
has:
if (content.match(/^module\.exports/)) {
var firstQuote = findQuote(content, false);
var secondQuote = findQuote(content, true);
html = content.substr(firstQuote, secondQuote - firstQuote + 1);
} else {
html = content;
}
but ng-cache
hasn't and accepts html only because of:
try {
source = htmlMinifier.minify(source, extend({}, opts));
} catch (e) {
this.emitWarning(e.toString() + '\nUsing unminified HTML');
}
Takes for me about 2 hours to understand what the problem.
Jade has been renamed to Pug, and it's appropriate for this module to depend on Pug instead of Jade now.
I also volunteer to maintain this under the umbrella of @pugjs, as we now do for pug-loader.