I'm developing nodejs application and I have issue with include statement. It works when I use it like this:
include ../mixins/root.pug
...but is it possible to use variables on include?
None of these work:
include #{process.env.MIXINS_PATH}/root.pug
include !{process.env.MIXINS_PATH}/root.pug
include `${process.env.MIXINS_PATH}/root.pug`
Result is this:
Error: ENOENT: no such file or directory
I'm developing nodejs application and I have issue with include statement. It works when I use it like this:
include ../mixins/root.pug
...but is it possible to use variables on include?
None of these work:
include #{process.env.MIXINS_PATH}/root.pug
include !{process.env.MIXINS_PATH}/root.pug
include `${process.env.MIXINS_PATH}/root.pug`
Result is this:
Error: ENOENT: no such file or directory
Share
edited May 8, 2016 at 0:45
Feathercrown
2,5911 gold badge18 silver badges31 bronze badges
asked May 8, 2016 at 0:24
Esa HannilaEsa Hannila
1,3182 gold badges16 silver badges34 bronze badges
1 Answer
Reset to default 3Dynamic includes are not supported:
We don't support "Dynamic Include". There are lots of issues people have opened about this. It's really plex to implement and not actually nearly as useful as people think it would be.
https://github./pugjs/pug/issues/2622#issuement-270157667