bluewings / pug-as-jsx-loader

MIT License
188 stars 15 forks source link

support multi template functions #49

Closed billypon closed 4 years ago

billypon commented 4 years ago

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 commented 4 years ago

https://github.com/bluewings/pug-as-jsx-utils/pull/14

bluewings commented 4 years ago

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