S
S
Sergey2020-10-13 01:30:55
HTML
Sergey, 2020-10-13 01:30:55

How to set up the ejs templating engine for local development (no node.js server, express, etc.)?

How to correctly write the npm run command for the template engine ( ejs , ejs-cli ) so that it collects different components from the components/ directory and renders everything into one final index.html file?

In the version from the ejs-cli documentation, the command

ejs-cli --base-dir components/ "**/*.ejs" --out dest/
takes all the necessary files and simply compiles them into different HTML files in a different directory.

Or is it possible to only compile index.ejs which includes other rendered .ejs files?

And what module can track changes in .ejs files so that they are immediately compiled on save?

I would be glad for any useful information, or a link to explanatory documentation)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2021-01-18
@Sergey-Nag

In general, at random, I came to this solution:
I connected an additional watch module to track file changes.
I run everything together as a team

watch --interval=1 \"ejs-cli --base-dir src/ \"**/*.ejs\" -e src/components --out public/\" src/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question