Closed BassOfBass closed 3 years ago
In some situations it will work out of the box - but its not a drop in replacement. pug-loader will attempt to inline includes I believe where as this package just uses pug. If you can make a reproducible example I am happy to help debug.
For some reason the repro doesn't throw any errors, so I'll just show errors according to this branch (btw I am not using any include
s, so it couldn't be the source of problems).
If you really want to look at the errors, you can clone it and run npm install && npm run dev
in it.
> pug_html = pug_html + "\u003Cprogress" + (pug.attr("max", max, true, true)+p ug.attr("value", value, true, true)) + "\u003E\u003Cdiv class=\"progress-bar\" \u003E\u003Cspan" + (pug.attr("style", pug.style(`width: ${current}%`), true, true)) + "\u003E" + (pug.escape(null == (pug_interp = current) ? "" : pug_inte rp)) + "%
This I assume is progressBar
mixin.
`, true, true)+" sizes=\"(max-width: 375px) 375px,
This is srcset
string.
pug_html = pug_html + "\u003C!DOCTYPE html\u003E\u003Chtml...
This one is a bit long, but it looks like [`this template`](https://github.com/BassOfBass/landing-page/blob/todo-app/src/templates/test/test.pug). Judging by `(function (Date) {` at the error start it doesn't like [`new Date()` invocations](https://github.com/BassOfBass/landing-page/blob/780833fdbc95579a19a01fb1ab2d9fdb1d724d26/src/templates/test/test.pug#L120) in the template.
At first I thought at least the second error has to do something with a template literal spanning several lines, but exact same structure in repro works fine. Also is there a reason these errors get duplicated 4 times?
@BassOfBass thanks so much for filing the issue! I found a core bug that was causing the compiled functions to break lines inside of strings. It has nothing to do with your code. Please install version 0.1.2 by running npm install simple-pug-loader
and retry - it should work well for you now.
Because I get a bunch of
thrown while using this.