sagold / handlebars-webpack-plugin

Renders your html-template at build time
161 stars 45 forks source link

Required .hbs extension for partials #7

Closed duncanwerner closed 7 years ago

duncanwerner commented 7 years ago

I want to use partials as includes, but I don't (necessary) want to use the .hbs extension, at least while I'm transitioning. This extension is required by the regex in getPartialId().

I'm not sure if this is something that you want to fix, but changing the regex will work the same way for any extension (although an extension is still required):

function getPartialId(path) {
  return path.match(/\/([^\/]+\/[^\/]+)\.[^\.]+$/).pop();
}
sagold commented 7 years ago

Hey duncan, I changed the regex in 8f68abe361d17e92b61ff37a2b0506ed1d1688d3. Thanks for the feedback.