title: _angular.angular undefined error when loading angular app built by webpack
body: <p>I am trying to bootstrap an AngularJS app built with Webpack. But I get the following error and the module isn't set up.</p>
  
  <pre><code>TypeError: _angular.angular is undefined
  </code></pre>
  
  <p>I dig into the generated code chunk and find that the <code>_angular.angular</code> is from</p>
  
  <pre><code>var _angular = __webpack_require__(1);
  
  var _angularUiBootstrap = __webpack_require__(3);
  
  _angular.angular.module('app', [_angularUiBootstrap.bootstrap]).constant('_', window._).run(function ($rootScope) {
    $rootScope._ = window._;
  </code></pre>
  
  <p>It looks like that <code>_angular.angular.module</code> should be <code>_angular.module</code>. I probably use a wrong way to bootstrap angular, or use an incorrect Webpack configuration. Here is my code:</p>
  
  <p><strong>webpack.config.js</strong></p>
  
  <pre><code>var webpack = require('webpack');
  var path = require('path');
  var ExtractTextPlugin = require('extract-text-webpack-plugin');
  
  var srcDir = 'static_src';
  var outputDir = 'static';
  
  module.exports = {
    devtool: 'source-map',
    debug: true,
    entry: {
      app: path.resolve(srcDir, 'app.js')
    },
    output: {
      path: outputDir,
      filename: '[name].bundle.js',
      sourceMapFilename: '[name].map',
      chunkFilename: '[id].chunk.js'
    },
    resolve: {
      extensions: ['', '.js', '.less', '.css'],
      alias: {
        npm: __dirname + '/node_modules'
      }
    },
    module: {
      loaders: [
        {
          test: /\.js$/,
          loader: 'babel',
          query: {
            presets: ['es2015'],
            plugins: ['syntax-decorators', 'ng-annotate']
          },
          exclude: /node_module/
        },
        { test: /\.less$/, loader: 'to-string!css!less' },
        { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader') },
        { test: /\.(png|gif|jpg)$/, loader: 'file?name=images/[name].[ext]' }
      ]
    },
    plugins: [
      new webpack.NoErrorsPlugin(),
      new webpack.optimize.DedupePlugin(),
      new ExtractTextPlugin('[name].css')
    ]
  };
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>import { angular } from 'angular';
  import { bootstrap } from 'angular-ui-bootstrap';
  
  angular.module('app', [bootstrap]);
  </code></pre>
  
  <p>I am using angular 1.5.0 and webpack 1.12.14.</p>
  
  <p>Thanks in advance.</p>