Closed WiNloSt closed 8 years ago
Interesting. I'll look into it and get back to you shortly.
It's fixed and released as v2.0.2. Webpack makes it very difficult to test for these kinds of problems, so let me know if you have any other issues. And thanks for your contribution to this project.
Thank you very much. However I'm back to using html-loader
because all I wanted from a template engine is just to include other partial template, which I found later that html-loader
can do that. Anyway if I have a chance to test this bug I'll let you know.
Don't go to any trouble to test it; this bug is fixed.
Thanks again.
Doesn't seem to be fixed for me. I'm on ejs-html-loader
3.1.0, webpack 3.8.1, and running into this issue
@WiNloSt I know it was a long time ago that you had this issue, but did you get html-loader
to compile nested templates like you describe in this issue? It seems to me that html-loader
can't handle nesting at all, and requiring a second partial from a partial throws a ReferenceError: require is not defined
.
@controversial Well, I did managed to handle nesting using html-loader
at the time. But that was like almost 2 years ago when I was using webpack1. I'm pretty sure things have changed a lot.
The thing is webpack has a bunch of configurations and any of the config or plugins or loaders could have caused the problem.
BTW, if you haven't manage to get this working, and you're happy to share your repository, I would look into solving the problem.
I tried using the syntax
<% include some/file %>
as suggested. Seems only the root and the immediate included templates will recompile when changed. For instance if I haveindex.ejs
a.ejs
b.ejs
And if I
require('./index.ejs')
somewhere. Only whenindex.ejs
anda.ejs
are changed, then webpack will recompile. But whenb.ejs
is changed, webpack will not recompile.I also tested including multiple templates in
index.ejs
, all of those included files includingindex.ejs
will cause webpack to recompile if they changed.I'm not sure if this is a bug or not. I'm not experience with ejs and webpack that much.