Skip to content

Instantly share code, notes, and snippets.

@SaravananSeenivasan
Last active December 15, 2016 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SaravananSeenivasan/c13d7a839a030ea81d11c67db3ddf6c1 to your computer and use it in GitHub Desktop.
Save SaravananSeenivasan/c13d7a839a030ea81d11c67db3ddf6c1 to your computer and use it in GitHub Desktop.
webpack demo - project 2
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { Rootcomponent } from '@app1/angular/app';
@NgModule({
imports: [BrowserModule],
declarations: [Rootcomponent],
bootstrap: [Rootcomponent]
})
export class AppModule {
}
<html>
<head>
<base href="/">
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="system.config.js"></script>
<script>
System.import('main').catch(function(err) {
console.error(err);
});
</script>
</head>
<body>
<Root>Loading......</Root>
</body>
</html>
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
(function(global) {
System.config({
"defaultJSExtensions": true,
paths: {
'npm:': 'node_modules/'
},
"map": {
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@kgfsl/angular': 'npm:@app1/angular',
"rxjs": "node_modules/rxjs",
"zone": "npm:zone.js/dist/Zone.js",
"core-js": "npm:core-js/index.js"
},
packages: {
app: {
main: './main.js',
defaultExtension: 'js'
},
"@app1/angular/app": {
format: 'cjs',
main: './dist/bundle.js',
defaultExtension: 'js'
},
rxjs: {
main: './Rx.js',
defaultExtension: 'js'
}
}
});
})(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment