I am assuming your webpack.config.js matches the following lines:
... module: { loaders: [ { test: /\.html$/, loader: "es6-template-string" } ] } ...
The problem is that template-string-loader outputs the exported template string using ES6 syntax. You still need to pass this through babel.
Your configuration should look something like this:
... module: { loaders: [ { test: /\.html$/, loader: "babel?presets[]=es2015!es6-template-string" } ] } ...
To use it, you need to call as a function:
import app from '../../bootstrap.js'; import template from './header.html'; app.component('siteHeader', { template() });
ijmacd
source share