import html template in typescript
问题 I'm trying to import my html template so that webpack will recognize them and include them when I build. ( webpack -d ) According to this GitHub issue I should do this declare module '*.html' { const _: string; export default _; } Then import template from './myTemplate.html'; should work. But it doesn't quite do the trick. import template from './myTemplate.html'; console.log(template); // undefined However this "works" import * as template from './myTemplate.html'; console.log(template); //