Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 1f7ed58

Browse files
mcescalantePatrickJS
authored andcommitted
chore: Bump angular to 4+, update year to 2017, HTML output for build via webpack (#158)
* bumping angular versions, updated year to 2017 * added html output for webpack on build * removed script tag to avoid loading zone/script twice * bump angular to 4+, bump other dependencies, update webpack config
1 parent da68a1f commit 1f7ed58

File tree

5 files changed

+562
-483
lines changed

5 files changed

+562
-483
lines changed

package.json

+25-24
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"description": "A simple starter Angular2 project",
55
"scripts": {
6-
"build": "webpack --progress",
6+
"build": "rimraf dist && webpack --progress",
77
"watch": "npm run build -- --watch",
88
"server": "webpack-dev-server --inline --progress --port 3000 --content-base src",
99
"start": "npm run server"
@@ -14,37 +14,38 @@
1414
],
1515
"license": "MIT",
1616
"dependencies": {
17-
"@angular/common": "~2.2.1",
18-
"@angular/compiler": "~2.2.1",
19-
"@angular/compiler-cli": "~2.2.1",
20-
"@angular/core": "~2.2.1",
21-
"@angular/forms": "~2.2.1",
22-
"@angular/http": "~2.2.1",
23-
"@angular/platform-browser": "~2.2.1",
24-
"@angular/platform-browser-dynamic": "~2.2.1",
25-
"@angular/platform-server": "~2.2.1",
26-
"@angular/router": "~3.2.1",
27-
"@angular/upgrade": "~2.2.1",
28-
"angular2-in-memory-web-api": "0.0.21",
29-
"bootstrap": "^3.3.7",
17+
"@angular/common": "~4.0.1",
18+
"@angular/compiler": "~4.0.1",
19+
"@angular/compiler-cli": "~4.0.1",
20+
"@angular/core": "~4.0.1",
21+
"@angular/forms": "~4.0.1",
22+
"@angular/http": "~4.0.1",
23+
"@angular/platform-browser": "~4.0.1",
24+
"@angular/platform-browser-dynamic": "~4.0.1",
25+
"@angular/platform-server": "~4.0.1",
26+
"@angular/router": "~4.0.1",
27+
"@angular/upgrade": "~4.0.1",
28+
"angular-in-memory-web-api": "^0.3.1",
3029
"core-js": "^2.4.1",
3130
"ie-shim": "^0.1.0",
32-
"reflect-metadata": "^0.1.3",
33-
"rxjs": "5.0.0-beta.12",
34-
"zone.js": "~0.6.26"
31+
"reflect-metadata": "^0.1.9",
32+
"rxjs": "5.0.1",
33+
"zone.js": "^0.8.4"
3534
},
3635
"devDependencies": {
37-
"@types/node": "^6.0.48",
36+
"@types/node": "^7.0.12",
3837
"angular2-router-loader": "^0.3.4",
3938
"angular2-template-loader": "^0.6.0",
40-
"awesome-typescript-loader": "^2.2.4",
41-
"css-loader": "^0.25.0",
39+
"awesome-typescript-loader": "^3.1.2",
40+
"css-loader": "^0.26.0",
41+
"html-webpack-plugin": "^2.28.0",
4242
"raw-loader": "^0.5.1",
43+
"rimraf": "^2.5.4",
4344
"to-string-loader": "^1.1.4",
44-
"typescript": "~2.0.10",
45-
"webpack": "2.1.0-beta.27",
46-
"webpack-dev-server": "2.1.0-beta.11",
47-
"webpack-merge": "^0.15.0"
45+
"typescript": "~2.2.0",
46+
"webpack": "^2.4.1",
47+
"webpack-dev-server": "2.4.2",
48+
"webpack-merge": "^4.1.0"
4849
},
4950
"keywords": [
5051
"Angular2",

src/app/app.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ <h3>
2525

2626

2727
<footer>
28-
© 2016
28+
© 2017
2929
</footer>

src/index.html

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@
1212
Loading...
1313
</app>
1414

15-
<script async src="/main.bundle.js"></script>
16-
1715
</body>
1816
</html>

webpack.config.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var webpack = require('webpack');
22
var path = require('path');
33
var webpackMerge = require('webpack-merge');
4+
var HtmlWebpackPlugin = require('html-webpack-plugin');
45

56
// Webpack Config
67
var webpackConfig = {
@@ -16,12 +17,17 @@ var webpackConfig = {
1617
plugins: [
1718
new webpack.ContextReplacementPlugin(
1819
// The (\\|\/) piece accounts for path separators in *nix and Windows
19-
/angular(\\|\/)core(\\|\/)src(\\|\/)linker/,
20-
path.resolve(__dirname, './src'),
20+
/angular(\\|\/)core(\\|\/)@angular/,
21+
path.resolve(__dirname, '../src'),
2122
{
2223
// your Angular Async Route paths relative to this root directory
2324
}
2425
),
26+
27+
new HtmlWebpackPlugin({
28+
template: 'src/index.html'
29+
}),
30+
2531
],
2632

2733
module: {

0 commit comments

Comments
 (0)