-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: use webpack for building apps.
This pull request replaces the underlying broccoli build system and then replaces it with webpack as the build and bundler. This will affect the following commands (however the user-level) functionality should go unchanged (besides unimplemented flags which will come after this PR.): ng build (with --env flag and --watch flag supported) ng serve (with --port flag supported) ng test / ng e2e The webpack configuration is blackboxed, and therefore users will not see a webpack.config.js file in their repository. Also this PR will bump the typescript version to 2.0 (beta). Fixes #909 #1155 #882
- Loading branch information
1 parent
8126785
commit cf04a93
Showing
46 changed files
with
2,240 additions
and
6,221 deletions.
There are no files selected for viewing
49 changes: 32 additions & 17 deletions
49
addon/ng2/blueprints/mobile/files/__path__/main-app-shell.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
import 'angular2-universal-polyfills'; | ||
import { provide } from '@angular/core'; | ||
import { APP_BASE_HREF } from '@angular/common'; | ||
import { APP_SHELL_BUILD_PROVIDERS } from '@angular/app-shell'; | ||
import { AppComponent } from './app/'; | ||
import { | ||
REQUEST_URL, | ||
ORIGIN_URL | ||
import { | ||
REQUEST_URL, | ||
ORIGIN_URL, | ||
Bootloader, | ||
BootloaderConfig, | ||
AppConfig | ||
} from 'angular2-universal'; | ||
import { AppComponent } from './app/'; | ||
|
||
export const options = { | ||
directives: [ | ||
// The component that will become the main App Shell | ||
AppComponent | ||
], | ||
const bootloaderConfig: BootloaderConfig = { | ||
platformProviders: [ | ||
APP_SHELL_BUILD_PROVIDERS, | ||
provide(ORIGIN_URL, { | ||
useValue: '' | ||
}) | ||
useValue: 'http://localhost:4200' // full urls are needed for node xhr | ||
}), | ||
provide(APP_BASE_HREF, { useValue: '/' }), | ||
], | ||
async: true, | ||
preboot: false | ||
} | ||
|
||
const appConfig: AppConfig = { | ||
directives: [ | ||
// The component that will become the main App Shell | ||
AppComponent | ||
], | ||
providers: [ | ||
// What URL should Angular be treating the app as if navigating | ||
provide(APP_BASE_HREF, {useValue: '/'}), | ||
provide(REQUEST_URL, {useValue: '/'}) | ||
], | ||
async: false, | ||
preboot: false | ||
}; | ||
provide(REQUEST_URL, { useValue: '/' }) | ||
] | ||
} | ||
|
||
export function getBootloader() : Bootloader { | ||
return new Bootloader(bootloaderConfig); | ||
} | ||
|
||
export function serialize(bootloader: Bootloader, template: string) : string { | ||
appConfig.template = template; | ||
return bootloader.serializeApplication(appConfig); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Prefer CoreJS over the polyfills above | ||
import 'core-js/es6'; | ||
import 'core-js/es7/reflect'; | ||
import 'zone.js/dist/zone'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
/*global jasmine, __karma__, window*/ | ||
require('core-js/es6'); | ||
require('core-js/es7/reflect'); | ||
|
||
// Typescript emit helpers polyfill | ||
require('ts-helpers'); | ||
|
||
require('zone.js/dist/zone'); | ||
require('zone.js/dist/long-stack-trace-zone'); | ||
require('zone.js/dist/jasmine-patch'); | ||
require('zone.js/dist/async-test'); | ||
require('zone.js/dist/fake-async-test'); | ||
require('zone.js/dist/sync-test'); | ||
|
||
// RxJS | ||
require('rxjs/Rx'); | ||
|
||
Promise.all([ | ||
System.import('@angular/core/testing'), | ||
System.import('@angular/platform-browser-dynamic/testing') | ||
]).then(function (providers) { | ||
let testing = providers[0]; | ||
let testingBrowser = providers[1]; | ||
|
||
testing.setBaseTestProviders(testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, | ||
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); | ||
}); | ||
|
||
let testContext = require.context('../src', true, /\.spec\.ts/); | ||
|
||
/* | ||
* get all the files, for each file, call the context function | ||
* that will require the file and load it up here. Context will | ||
* loop and require those spec files here | ||
*/ | ||
function requireAll(requireContext) { | ||
return requireContext.keys().map(requireContext); | ||
} | ||
|
||
requireAll(testContext); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
{ | ||
"compileOnSave": false, | ||
"compilerOptions": { | ||
"baseUrl":"./src", | ||
"declaration": false, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"mapRoot": "/", | ||
"module": "commonjs", | ||
"module": "es6", | ||
"target": "es5", | ||
"moduleResolution": "node", | ||
"noEmitOnError": true, | ||
"noImplicitAny": false, | ||
"outDir": "../dist/", | ||
"outDir": "./dist/", | ||
"rootDir": ".", | ||
"sourceMap": true, | ||
"target": "es5", | ||
"inlineSources": true | ||
"sourceMap": true | ||
}, | ||
|
||
"files": [ | ||
"main.ts",<% if (isMobile) { %> | ||
"main-app-shell.ts",<% } %> | ||
"typings.d.ts" | ||
"compileOnSave": false, | ||
"buildOnSave": false, | ||
"exclude": [ | ||
"node_modules", | ||
"bower_components" | ||
], | ||
"includes": [ | ||
"**.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
|
||
// Typings reference file, see links for more information | ||
// https://github.com/typings/typings | ||
// https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html | ||
|
||
/// <reference path="<%= refToTypings %>/typings/browser.d.ts" /> | ||
<% if(!isMobile) { %>declare var module: { id: string };<% } %> | ||
/// <reference path="<%= refToTypings %>/typings/index.d.ts" /> | ||
/// <reference path="../node_modules/typescript/lib/lib.es2015.core.d.ts" /> | ||
/// <reference path="../node_modules/typescript/lib/lib.es2015.collection.d.ts" /> | ||
/// <reference path="../node_modules/typescript/lib/lib.es2015.promise.d.ts" /> | ||
|
||
<% if(!isMobile) { %> | ||
declare var System: any; | ||
declare var module: { id: string }; | ||
declare var require: any; | ||
<% } %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Typescript emit helpers polyfill | ||
import 'ts-helpers'; | ||
|
||
import '@angular/core'; | ||
import '@angular/common'; | ||
import '@angular/compiler'; | ||
import '@angular/http'; | ||
import '@angular/router'; | ||
import '@angular/platform-browser'; | ||
import '@angular/platform-browser-dynamic'; | ||
|
||
<% if(isMobile) { %> | ||
import '@angular/app-shell'; | ||
<% } %> | ||
|
||
import 'rxjs/add/operator/map'; | ||
import 'rxjs/add/operator/mergeMap'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
/// <reference path="../typings/main.d.ts" /> | ||
/// <reference path="../typings/index.d.ts" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
{ | ||
"ambientDevDependencies": { | ||
"globalDevDependencies": { | ||
"angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459", | ||
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438", | ||
"selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654" | ||
}, | ||
"ambientDependencies": { | ||
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654"<% if (isMobile) {%>, | ||
"node": "registry:dt/node#4.0.0+20160509154515" <% } %> | ||
"globalDependencies": { | ||
<% if (isMobile) {%>"node": "registry:dt/node#6.0.0+20160621231320" <% } %> | ||
} | ||
} |
Oops, something went wrong.