bluewings/pug-as-jsx-loader

support multi template functions

Closed this issue · 2 comments

Now, this loader will export a default function for template rendering, like this:

// template.pug
div foo
import template from './template.pug';

export default function foo() {
  return template();
}

But can we export multi functions? like this:

// template.pug
block foo
  div bar

or

// template.pug
mixin foo()
  div bar

then we can use other functions:

import template from './template.pug';

export default function foo() {
  return template.foo();
}

@billypon
Thanks for a good feature suggestion. I just merged your PR.
And you can use it in 1.0.87.