title: Can't load templates with routeprovider when using webpack
body: <p>I recentley migrated from grunt to webpack and I can't figure how to require/import my templates.  I have looked at several similar <a href="https://stackoverflow.com/questions/44889493/how-to-get-ngtemplate-loader-working-with-webpack-3-angular-1-typescript-and-e">issues</a> with no luck.</p>
  
  <p>Here is my <code>webpack.config</code> file: </p>
  
  <pre><code>  var webpack = require('webpack');
      var globby = require('globby');
      var path = require('path');
  
      var HtmlWebpackPlugin = require('html-webpack-plugin');
      var ExtractTextPlugin = require('extract-text-webpack-plugin');
      var CleanWebpackPlugin = require('clean-webpack-plugin');
      var AssetsPlugin = require('assets-webpack-plugin');
  
  
      var ExtractTextPlugin = require('extract-text-webpack-plugin');
      module.exports = {
          entry: {
              app: globby.sync(['./app/app.js','./app/app.run.js', './app/app.config.js', './app/**/*.js']),
              styles: globby.sync(['./content/styles/*.css']),
              images: globby.sync(['./content/images/*.*']),
              vendor: [
             // removed to save space
              ]
          },
          output: {
              filename: './scripts/[name].bundle.js',
              path: path.join(__dirname, "public")
          },
          devServer: {
              port: 1384,
              contentBase: './public/'
          },
  
          // Enable sourcemaps for debugging webpack's output.
          devtool: 'source-map',
  
          module: {
              rules: [
                  {   test: /\.less$/, 
                      loader: "less-loader",
                      include: path.resolve(__dirname, "content", "styles", "less")
                  },
                  {
                      test: /\.html$/,
                      use: [
                          {
                              loader: 'ngtemplate-loader',
                              options: {
                                  angular: true,
                              },
                          },
                          {
                              loader: 'raw-loader',
                          },
                          {
                              loader: 'html-loader'
                          },
                          {
                              loader: "ngtemplate!html?module=myTemplates&amp;relativeTo=" + 
                              (path.resolve(__dirname, './app/**'))
                          },
                      ],
                      /*
                      exclude: [/node_modules/]
                      */
                  },
                  {
                      test: /\.css$/,
                      loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' }),
                  },
                  {
                      test: /\.(ico)$/,
                      loader: "url-loader?name=./[name].[ext]",
                      include: path.resolve(__dirname, "content", "images")
                  },
                  {
                      test: /\.(jpg|jpeg|gif|png|tiff|svg)$/,
                      loader: "file-loader?name=./images/[name].[ext]",
                      include: path.resolve(__dirname, "content", "images")
                  },
                  {
                      test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
                      loader: 'url-loader?minetype=application/font-woff&amp;name=./fonts/[name].[ext]'
                  },
                  {
                      test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
                      loader: 'file-loader?name=./fonts/[name].[ext]'
                  },
                  {
                      test: require.resolve('adal-angular/lib/adal'),
                      loader: 'expose-loader?AuthenticationContext'
                  },
                  {
                      test: /\.js$/,
                      enforce: "pre",
                      loader: 'source-map-loader'
                  }
              ],
          },
  
          plugins: [
              new webpack.DefinePlugin({
                  ADMIN_API_URL: JSON.stringify('http://localhost:41118/api/'),
                  API_URL: JSON.stringify('http://localhost:32605/api/'),
                  GLOBAL_ADMIN_URL: JSON.stringify('https://adminapi.tradesolution.no/')
              }),
              new HtmlWebpackPlugin({
                  template: './app/layout.ejs',
                  filename: 'index.html'
              }),
              new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: './scripts/vendor.bundle.js' }),
              new ExtractTextPlugin({ filename: './styles/[name].bundle.css' }),
              /*new CleanWebpackPlugin(['public'], {
                  verbose: false
              }),
              */
              new AssetsPlugin({
                  filename: 'webpack.assets.json',
                  path: './public/scripts',
                  prettyPrint: true
              }),
              new webpack.ProvidePlugin({
                  $: 'jquery',
                  jQuery: 'jquery',
                  'window.jQuery': 'jquery',
                  'window.$': 'jquery',
                  "window.AuthenticationContext": "AuthenticationContext",
                  _: 'underscore'
              }),
          ],
          externals: [
              { xmlhttprequest: '{XMLHttpRequest:XMLHttpRequest}' }
          ],
  
  
      }
  </code></pre>
  
  <p>The public folder builds as it should with .js, styles, images etc. But simple navigation results in this error:   </p>
  
  <pre><code>ERROR in ./app/app.config.js
  Module not found: Error: Can't resolve 'app/varegruppe/templates/index.html' in 'C:\Users\oystein\work\EPD.SPA\EpdSPA\app'
   @ ./app/app.config.js 50:25-71
  </code></pre>
  
  <p>Here is an example of how the routes are defined: </p>
  
  <pre><code>  $routeProvider.when('/produkteier', {
              templateUrl: require('app/produkteier/templates/view.html')
          })
  </code></pre>