My nodejs based application uses Pug for rendering; specifically, i set the view engine and then set the view directory (which lives inside of the src directory that all other source lives in.
app.set('view engine', 'pug');
app.set('views', __dirname + '/views');
Which reflects the directory structure of my code:
Unfortunately, this fails to work when the application is compiled and ruins index.js; it cannot find the .pug files in /dist/views: Error: Failed to lookup view "posts" in views directory "/app/dist/views"