Skip to content

Commit 11d2cf5

Browse files
committed
1. Added comments 2. Added gitignore
1 parent 6fb2569 commit 11d2cf5

8 files changed

+36
-31
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
typings
3+
app/*.js
4+
app/*.map
5+
main.*js
6+
main.*map

app/app.component.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
/**
2+
* Main App component
3+
*/
4+
15
import { Component } from '@angular/core';
26

37
@Component({
48
selector: 'my-app',
5-
template : '<h1>Hello</h1>'
9+
template : '<h1>Welcome to Angular 2 With Webpack</h1>'
610
})
711

812

index.html

+6-29
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,21 @@
11
<html>
22

33
<head>
4-
<title>My AngWP app</title>
4+
<title>Angular 2 Wepack</title>
55
<meta name="viewport" content="width=device-width,initial-scale=1">
66
</head>
77

88
<body>
9+
<!--Content-->
910
<my-app>View is loading</my-app>
1011

12+
<!--Polyfills -->
1113
<script src="node_modules/core-js/client/shim.min.js"></script>
1214
<script src="node_modules/zone.js/dist/zone.js"></script>
1315
<script src="node_modules/reflect-metadata/Reflect.js"></script>
16+
17+
<!--Dependencies-->
1418
<script src="dist/bundle.js"></script>
1519
</body>
1620

17-
</html>
18-
19-
<!--<html>
20-
21-
<head>
22-
<title>Angular 2 QuickStart</title>
23-
<meta charset="UTF-8">
24-
<meta name="viewport" content="width=device-width, initial-scale=1">
25-
<link rel="stylesheet" href="styles.css">
26-
<!-- 1. Load libraries -->
27-
<!-- Polyfill(s) for older browsers -->
28-
<!--<script src="node_modules/core-js/client/shim.min.js"></script>
29-
<script src="node_modules/zone.js/dist/zone.js"></script>
30-
<script src="node_modules/reflect-metadata/Reflect.js"></script>
31-
<script src="node_modules/systemjs/dist/system.src.js"></script>-->
32-
<!-- 2. Configure SystemJS -->
33-
<!--<script src="systemjs.config.js"></script>
34-
<script>
35-
System.import('app').catch(function(err){ console.error(err); });
36-
</script>
37-
</head>-->
38-
<!-- 3. Display the application -->
39-
40-
<!--<body>
41-
<my-app>Loading...</my-app>
42-
</body>
43-
44-
</html>-->
21+
</html>

main.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* This will bootstrap the Angular Project
3+
*/
4+
15
import { bootstrap } from '@angular/platform-browser-dynamic';
26
import { AppComponent } from './app/app.component';
37

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
2-
"name": "MyAppWP",
2+
"name": "angular-webpack-sample",
33
"version": "1.0.0",
4+
"description": "This is a simple example of how to use webpack in Angular 2",
5+
"repository": {
6+
"git":"https://github.com/manjunathshetty/angular2-wepack-sample.git"
7+
},
8+
"license": "ISC",
49
"scripts": {
510
"build": "webpack",
611
"start": "tsc && webpack-dev-server",

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"comments":"Typescript Compiler options",
23
"compilerOptions": {
34
"target": "es5",
45
"module": "commonjs",

typings.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"comments":"Typescript type definition files",
23
"globalDependencies": {
34
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
45
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",

webpack.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*Webpack configuration file*/
2+
/**
3+
* Entry files : main.ts - Entry to the app
4+
* Output: dist/bundle.js - Output location
5+
* Resolve: js,ts files - Telling wepack how to resolve files`
6+
* Module: ts with ts-loader - Typescript loader
7+
*/
18
module.exports = {
29
entry: "./main.ts",
310
output: {

0 commit comments

Comments
 (0)