Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support exporting a template function #120

Closed
michael-ciniawsky opened this issue Mar 28, 2017 · 3 comments
Closed

feat: support exporting a template function #120

michael-ciniawsky opened this issue Mar 28, 2017 · 3 comments
Assignees

Comments

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Mar 28, 2017

I'm submitting a feature request

Template ({Function})

component.html

<div>${ _.hello }<div>

webpack.config.js

{
  loader: 'html-loader', options: { template: true }
}

component.js

import template from './component.html'

const component = template({ hello: 'Hello World!' })
// <div>Hello World!</div>
@Jerry2Lemon
Copy link

This feature should be very convenient, but it hasn't been merge to the release version after half year

@michael-ciniawsky
Copy link
Member Author

@denis-migdal
Copy link

Alternatively, I created a loader that might do something close to what you want to achieve:
https://github.com/denis-migdal/prehtml-loader

Else, by disabling interpolation, you could also use template-string-loader:
https://github.com/bradbenvenuti/template-string-loader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants