Typescript 2.0 and Webpack importing of HTML as string : <p>I'm trying to import a HTML file as string with the help of webpack (Currently using webpack because TypeScript 2.0 doesn't support async/await on non ES6 targets).</p>

<p>The problem I have is, even if the html-loader version from github supports a config flag 'exportAsEs6Default' i don't get it to set correctly. Is there any way to set a loader options globally? Because if I add the html-loader to the loaders section in the config file the loader is called twice causing the content to be nested.</p>

<hr>

<p>I have the following definition file to support importing of HTML (like in the example on <a href="https://www.typescriptlang.org/docs/handbook/modules.html" rel="noreferrer">the modules documentation</a>)</p>

<pre><code>declare module "html!*" {
    const content: string;
    export default content;
}
</code></pre>

<p>The corresponsing import statement:</p>

<pre><code>import templateString from "html!./Hello.html";
</code></pre>

<p>The versions of the packages I use:</p>

<pre><code>"babel-core": "^6.17.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.16.0",
"html-loader": "git://github.com/webpack/html-loader.git#4633a1c00c86b78d119b7862c71b17dbf68d49de",
"ts-loader": "^0.9.5",
"typescript": "2.0.3",
"webpack": "^1.13.2"
</code></pre>

<p>And the webpack config file</p>

<pre><code>"use strict";

module.exports = {
    entry: "./WebApp/Hello.ts",
    output: {
        path: "./wwwroot/compiled",
        filename: "app.bundle.js"
    },
    resolve: {
        extensions: ["", ".webpack.js", ".web.js", ".js", ".ts"]
    },
    module: {
        loaders: [
            {
                test: /\.ts$/,
                exclude: /node_modules/,
                loader: "babel-loader!ts-loader"
            },
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: "babel-loader"
            }
        ]
    }
};
</code></pre>
