Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs(aot-cb):bundle in-mem-web-api using esm and umd #2617

Merged
merged 1 commit into from
Oct 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions public/docs/_examples/_boilerplate/systemjs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
Expand All @@ -36,10 +36,6 @@
},
rxjs: {
defaultExtension: 'js'
},
'angular-in-memory-web-api': {
main: './index.js',
defaultExtension: 'js'
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
'ts': 'npm:[email protected]/lib/plugin.js',
'typescript': 'npm:[email protected]/lib/typescript.js',

Expand All @@ -64,10 +64,6 @@
},
rxjs: {
defaultExtension: 'js'
},
'angular-in-memory-web-api': {
main: './index.js',
defaultExtension: 'js'
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
'ts': 'npm:[email protected]/lib/plugin.js',
'typescript': 'npm:[email protected]/lib/typescript.js',

Expand All @@ -51,10 +51,6 @@
},
rxjs: {
defaultExtension: 'js'
},
'angular-in-memory-web-api': {
main: './index.js',
defaultExtension: 'js'
}
}
});
Expand Down
2 changes: 2 additions & 0 deletions public/docs/_examples/toh-6/ts/aot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<title>Angular Tour of Heroes</title>
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="styles.css">

<script src="shim.min.js"></script>
<script src="zone.min.js"></script>
<!-- #docregion moduleId -->
Expand Down
2 changes: 1 addition & 1 deletion public/docs/_examples/toh-6/ts/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AppRoutingModule } from './app-routing.module';

// #enddocregion v1
// Imports for loading & configuring the in-memory web api
import { InMemoryWebApiModule } from 'angular-in-memory-web-api/in-memory-web-api.module';
import { InMemoryWebApiModule } from 'angular-in-memory-web-api';
import { InMemoryDataService } from './in-memory-data.service';

// #docregion v1
Expand Down
3 changes: 2 additions & 1 deletion public/docs/_examples/toh-6/ts/copy-dist-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
var fs = require('fs');
var resources = [
'node_modules/core-js/client/shim.min.js',
'node_modules/zone.js/dist/zone.min.js'
'node_modules/zone.js/dist/zone.min.js',
'styles.css'
];
resources.map(function(f) {
var path = f.split('/');
Expand Down
13 changes: 5 additions & 8 deletions public/docs/_examples/toh-6/ts/rollup-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ export default {
sourceMapFile: 'aot/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()
nodeResolve({jsnext: true, module: true}),
commonjs({
include: ['node_modules/rxjs/**']
}),
uglify()
]
}
7 changes: 0 additions & 7 deletions public/docs/ts/latest/cookbook/aot-compiler.jade
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,6 @@ a#toh

Rollup does the Tree Shaking as before.

The Rollup configuration changes slightly to accommodate the `angular-in-memory-web-api` module
that the _Tour of Heroes_ app requires for data server simulation.

The `angular-in-memory-web-api` is a `commonjs` module like the RxJS library.
Add `angular-in-memory-web-api` to the _commonjs plugin_ `include` array,
next to the `rxjs` file specification.

+makeExample('toh-6/ts/rollup-config.js',null,'rollup-config.js')(format='.')

:marked
Expand Down
Binary file modified public/resources/images/cookbooks/aot-compiler/toh6-bundle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.