title: Can't resolve declaration with ts-loader and webpack
body: <h1>Context</h1>
  
  <ul>
  <li>"ts-loader": "^6.2.1",</li>
  <li>"typescript": "^3.7.2",</li>
  <li>"webpack": "^4.41.2",</li>
  <li>"webpack-cli": "^3.3.9",</li>
  <li>"webpack-dev-middleware": "^3.7.2",</li>
  <li>"webpack-dev-server": "^3.9.0"</li>
  </ul>
  
  <h1>Issue</h1>
  
  <p>In order to import <code>.html</code> file, i am using the following declaration in a file <code>html-loader.ts</code> :</p>
  
  <pre class="lang-js prettyprint-override"><code>declare module "html-loader!*" {
      const content: string;
      export default content;
  }
  </code></pre>
  
  <p>This declaration is used in an other file as follow :</p>
  
  <pre class="lang-js prettyprint-override"><code>import htmlcode from 'html-loader!./template.html';
  
  ...
  </code></pre>
  
  <p>The project is built using <strong><code>webpack</code></strong> and  <strong><code>ts-loader</code></strong>.</p>
  
  <p>Here is the content of <code>tsconfig.json</code> used by <code>ts-loader</code>.</p>
  
  <pre class="lang-js prettyprint-override"><code>{
    "compilerOptions": {
      "outDir": "dist",
      "module": "commonjs",
      "target": "es5",
      "lib": [ "es2015", "dom" ],
      "sourceMap": true,
      "esModuleInterop": true,
      "removeComments": true,
      "noEmitOnError": true,
      "declaration": true
    }
  }
  </code></pre>
  
  <p>Here is the <code>webpack.config.js</code> :</p>
  
  <pre class="lang-js prettyprint-override"><code>const path = require('path');
  
  module.exports = {
    entry: {
      'lib': './src/index.ts',
    },
    devtool: 'source-map',
    mode: 'development',
    output: {
      filename: '[name].bundle.js',
      path: path.resolve(__dirname, 'dist'),
      library: '[name]',
      libraryTarget: 'umd',
      umdNamedDefine: true,
    },
    module: {
        rules: [
          {
              test: /\.ts$/,
              use: 'ts-loader',
              exclude: /node_modules/,
            },
        ]
    },
    resolve: {
      extensions: [ '.ts', '.js' ],
    },
  };
  </code></pre>
  
  <p>The bundles are built but the built command <code>webpack</code> exit with error code <code>130</code> and the following message :</p>
  
  <blockquote>
    <p>Module not found: Error: Can't resolve 'html-loader' in '/path/to/file_that_use_declaration'</p>
  </blockquote>
  
  <p>Any idea ?</p>