ericf / express-handlebars

A Handlebars view engine for Express which doesn't suck.
BSD 3-Clause "New" or "Revised" License
2.31k stars 384 forks source link

exhbs / express? refuses to switch from first defined viewsDir #264

Closed Twiggeh closed 3 years ago

Twiggeh commented 4 years ago

To recreate : have 2 node apps in this configuration :

      📁 nodeapp2
            nodeapp2.js
            📁 views
                  index2.hbs
      app.js
      📁 views
            index.hbs

app.set('views', path.join(__dirname, 'views'));

const hbs = handlebars.create({
  extname: 'hbs',
  defaultLayout: 'layout',
  layoutsDir: __dirname + '/views'
  }
});

Edit : Thought that layoutsDir was also the one pointing to the views. Shouldn't have express taken the correct views though ? It is in the correct place ...

Following this a different error arises exhbs3