forked from johnpapa/angular-tour-of-heroes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 2.0.2 * aot * more aot with gzip * fix * fix * support sourcemaps for js * css for mobile * npm scripts
- Loading branch information
Showing
14 changed files
with
263 additions
and
35 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -5,3 +5,5 @@ app/**/*.map | |
node_modules | ||
jspm_packages | ||
bower_components | ||
aot/* | ||
dist/* |
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
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 |
---|---|---|
|
@@ -12,4 +12,5 @@ | |
#search-box{ | ||
width: 200px; | ||
height: 20px; | ||
border: 1px solid lightgray; | ||
} |
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,7 @@ | ||
import { platformBrowser } from '@angular/platform-browser'; | ||
|
||
import { AppModuleNgFactory } from '../aot/app/app.module.ngfactory'; | ||
|
||
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory) | ||
.then(success => console.log(`Bootstrap success`)) | ||
.catch(error => console.log(error)); |
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,75 @@ | ||
var gulp = require('gulp'); | ||
var del = require('del'); | ||
var $ = require('gulp-load-plugins')({ lazy: true }); | ||
var lite = require('lite-server'); | ||
|
||
var config = { | ||
build: './dist/build.js', | ||
plugins: [ | ||
'node_modules/core-js/client/shim.min.js', | ||
'node_modules/zone.js/dist/zone.js' | ||
], | ||
index: { | ||
run: 'index.html', | ||
aot: 'index-aot.html', | ||
aotgz: 'index-aot-gzip.html', | ||
jit: 'index-jit.html' | ||
}, | ||
dest: './dist', | ||
root: './' | ||
}; | ||
|
||
gulp.task('help', $.taskListing); | ||
gulp.task('default', ['help']); | ||
|
||
gulp.task('gzip', function () { | ||
log('gzipping'); | ||
var source = [].concat(config.plugins, config.build); | ||
|
||
return gulp.src(source) | ||
.pipe($.gzip()) | ||
.pipe(gulp.dest(config.dest)); | ||
}); | ||
|
||
gulp.task('copy-aot-gz', ['clean'], function () { | ||
log('copy aot gz'); | ||
return copyIndex(config.index.aotgz); | ||
}); | ||
|
||
gulp.task('copy-aot', ['clean'], function () { | ||
log('copy aot'); | ||
return copyIndex(config.index.aot); | ||
}); | ||
|
||
function copyIndex(source) { | ||
return gulp.src(source) | ||
.pipe($.rename(config.index.run)) | ||
.pipe(gulp.dest(config.root)); | ||
} | ||
|
||
gulp.task('copy-jit', ['clean'], function () { | ||
log('copy jit'); | ||
return copyIndex(config.index.jit); | ||
}); | ||
|
||
gulp.task('clean', function (done) { | ||
log('clean'); | ||
del([config.index.run]).then(paths => { | ||
// console.log('Deleted files and folders:\n', paths.join('\n')); | ||
done() | ||
}); | ||
}); | ||
|
||
function log(msg) { | ||
if (typeof (msg) === 'object') { | ||
for (var item in msg) { | ||
if (msg.hasOwnProperty(item)) { | ||
$.util.log($.util.colors.blue(msg[item])); | ||
} | ||
} | ||
} else { | ||
$.util.log($.util.colors.blue(msg)); | ||
} | ||
} | ||
|
||
module.exports = gulp; |
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,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<base href="/"> | ||
<title>Angular Tour of Heroes</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="stylesheet" href="styles.css"> | ||
<script src="dist/shim.min.js.gz"></script> | ||
<script src="dist/zone.js.gz"></script> | ||
|
||
<!-- #docregion moduleId --> | ||
<script>window.module = 'aot';</script> | ||
<!-- #enddocregion moduleId --> | ||
</head> | ||
|
||
<body> | ||
<my-app>Loading...</my-app> | ||
</body> | ||
<script src="dist/build.js.gz"></script> | ||
|
||
</html> |
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,24 @@ | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<base href="/"> | ||
<title>Angular Tour of Heroes</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="stylesheet" href="styles.css"> | ||
<script src="node_modules/core-js/client/shim.min.js"></script> | ||
<script src="node_modules/zone.js/dist/zone.js"></script> | ||
|
||
<!-- #docregion moduleId --> | ||
<script>window.module = 'aot';</script> | ||
<!-- #enddocregion moduleId --> | ||
</head> | ||
|
||
<body> | ||
<my-app>Loading...</my-app> | ||
</body> | ||
<script src="dist/build.js"></script> | ||
|
||
</html> |
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,27 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<base href="/"> | ||
<title>Angular 2 Tour of Heroes</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="stylesheet" href="styles.css"> | ||
|
||
<!-- IE required polyfills, in this exact order --> | ||
<script src="node_modules/core-js/client/shim.min.js"></script> | ||
<script src="node_modules/zone.js/dist/zone.js"></script> | ||
<script src="node_modules/reflect-metadata/Reflect.js"></script> | ||
<script src="node_modules/systemjs/dist/system.src.js"></script> | ||
|
||
<script> | ||
System.import('system-config.js').then(function () { | ||
System.import('main'); | ||
}).catch(console.error.bind(console)); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<my-app>Loading...</my-app> | ||
</body> | ||
|
||
</html> |
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,27 +1,24 @@ | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<base href="/"> | ||
<title>Angular 2 Tour of Heroes</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="stylesheet" href="styles.css"> | ||
<head> | ||
<base href="/"> | ||
<title>Angular Tour of Heroes</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<!-- IE required polyfills, in this exact order --> | ||
<script src="node_modules/core-js/client/shim.min.js"></script> | ||
<script src="node_modules/zone.js/dist/zone.js"></script> | ||
<script src="node_modules/reflect-metadata/Reflect.js"></script> | ||
<script src="node_modules/systemjs/dist/system.src.js"></script> | ||
<link rel="stylesheet" href="styles.css"> | ||
<script src="node_modules/core-js/client/shim.min.js"></script> | ||
<script src="node_modules/zone.js/dist/zone.js"></script> | ||
|
||
<script> | ||
System.import('system-config.js').then(function () { | ||
System.import('main'); | ||
}).catch(console.error.bind(console)); | ||
</script> | ||
<!-- #docregion moduleId --> | ||
<script>window.module = 'aot';</script> | ||
<!-- #enddocregion moduleId --> | ||
</head> | ||
|
||
<body> | ||
<my-app>Loading...</my-app> | ||
<my-app>Loading...</my-app> | ||
</body> | ||
<script src="dist/build.js"></script> | ||
|
||
</html> |
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,22 @@ | ||
import rollup from 'rollup' | ||
import nodeResolve from 'rollup-plugin-node-resolve' | ||
import commonjs from 'rollup-plugin-commonjs'; | ||
import uglify from 'rollup-plugin-uglify' | ||
|
||
export default { | ||
entry: 'app/main-aot.js', | ||
dest: 'dist/build.js', // output a single application bundle | ||
sourceMap: true, | ||
sourceMapFile: 'dist/build.js.map', | ||
format: 'iife', | ||
plugins: [ | ||
nodeResolve({ jsnext: true, module: true }), | ||
commonjs({ | ||
include: [ | ||
'node_modules/rxjs/**', | ||
'node_modules/angular-in-memory-web-api/**' | ||
], | ||
}), | ||
uglify() | ||
] | ||
} |
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,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "es2015", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"removeComments": false, | ||
"noImplicitAny": true, | ||
"suppressImplicitAnyIndexErrors": true, | ||
"types": [] | ||
}, | ||
|
||
"files": [ | ||
"app/app.module.ts", | ||
"app/main-aot.ts", | ||
"./typings/index.d.ts" | ||
], | ||
|
||
"angularCompilerOptions": { | ||
"genDir": "aot", | ||
"skipMetadataEmit" : true | ||
} | ||
} |