Answer the question
In order to leave comments, you need to log in
Webpack, how to import handlebars template not from entry point?
Good afternoon everyone.
There is the following structure (simplified):
src
- scripts
- templates
In scripts there are app.js and test.js files (app.js is the entry point for webpack)
app.js:
import Test from './test';
export default new Test();
import tpl from '../templates/test.hbs';
export default class {
constructor() {
var body = document.querySelector('body');
body.textContent = tpl({
name: 'world'
});
}
}
Hello {{name}}!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question