willyelm / pug-html-loader

Pug HTML loader for webpack

Home Page:https://github.com/willyelm/pug-html-loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot resolve files from absolute paths

duddu opened this issue · comments

I just switched to this jade loader, since it is the first one rightly using pug. So thank you!

I get the error above, e.g. when an img src is an absolute url: in that case, the loader breaks trying to request file ./\"http://....png\"

@duddu I compared this loader with jade-html-loader and found the problem:

let content = JSON.stringify(template(query))

If you try to rewrite source code of loader to

let content = template(query)

everything will work

also I changed

return `module.exports = ${content};`

to

 return content

because module.exports = string always appeared in my output html