Issue 1:
I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When using CommonJS (or ES2015 modules), the order of imports matters when importing an AngularJS app to bootstrap. Here is an example Plunkr that demonstrates the problem: https://plnkr.co/edit/lKE6a3sPqjMWvoWJF9oT?p=preview

But basically:

When AngularJS lives in: app.js like this one:

import * as angular from 'angular';

export default angular.module('app', [])
.run(function() { console.log('Angular 1 is running!')})

and Angular lives in main.ts like this one:

import 'core-js/es7/reflect';
import 'zone.js';

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { UpgradeModule } from '@angular/upgrade/static';
import { AppModule } from './app.module';

import app from '../app/app';

const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule).then(platformRef => {
const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule;
upgrade.bootstrap(document.body, [app.name], { strictDi: true})
})

The bootstrap will fail with:

Unhandled Promise rejection: AngularJS v1.x is not loaded! ; Zone: <root> ; Task: Promise.then ; Value: Error: AngularJS v1.x is not loaded!

However, moving import app from './app' before zone.js import, the bootstrap will work

Expected behavior

Importing an AngularJS app should work after the main dependency imports like zone.js and reflect and other libraries.

Minimal reproduction of the problem with instructions

Here is the Plunkr: https://plnkr.co/edit/lKE6a3sPqjMWvoWJF9oT?p=preview

The code above also recreates the problem

Please tell us about your environment: Windows 10, VSCode, Webpack bundling (SystemJS fails as well).

Angular version: Angular 4.1.0 and AngularJS 1.6.4

Browser: all

Language: TypeScript

Issue 2:
I'm submitting a ... (check one with "x")

[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Attempting to bootstrap a hybrid app using UpgradeModule, if AngularJS is loaded using import * as angular from 'angular' then the console reports the error 'AngularJS v1.x is not loaded!' if AngularJS is loaded from a script tag, the application boostraps correctly without error.

Expected behavior

It should be possible to load AngularJS using import

Minimal reproduction of the problem with instructions

not working - https://plnkr.co/edit/KJijAJY8lQYRnnwuGOSK?p=preview

working (with script tag) - https://plnkr.co/edit/VQWj0OOmY5SF2i2Y9RmI?p=preview

What is the motivation / use case for changing the behavior?

To allow AngularJS to be bundled easily and use its type definitions

Please tell us about your environment:

Chrome 58 on Windows 10

Angular version: 4.1

Browser: Chrome 58 on Windows 10

Language: Typescript 2.1