We are trying to set up GULP file to serve PUG files into HTML and put them into static dist folder.
Here are our files: https://github.com/ShooX512/gulp-testing/
This is how we control PUG so far:
app.set("views", path.join(__dirname, "./dist/"));
but because of the fact that GULP generates HTML files in dist we have added this:
app.use(
"./dist",
express.static(path.join(__dirname, "./dist"), { maxAge: "30 days" })
);
This unfortunately doesn't work.
My main questions are:
Which version of the code should be used and when?
How to pass data to generated HTML files in dist folder? (Originally PUG)
Do we need GULP to compile PUG at all if we use:
app.set("view engine", "pug");
app.set("views", path.join(__dirname, "./dist/"));