Skip to content

Commit 4b9d5e4

Browse files
chore(setup): update webpack to webpack 4
1 parent ffe5cc0 commit 4b9d5e4

File tree

6 files changed

+26
-34
lines changed

6 files changed

+26
-34
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This is, by no means, ment to be used blindly in production.
1414
- [x] TypeScript 2
1515
- [x] TSLint
1616
- [x] @types
17-
- [x] Webpack 3 + Webpack dev server
17+
- [x] Webpack 4 + Webpack dev server
1818
- [x] Karma + Jasmine
1919
- [ ] Protractor
2020
- [x] Styling using SASS

package.json

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@
3535
"@types/core-js": "^0.9.43",
3636
"@types/jasmine": "^2.8.2",
3737
"@types/node": "^9.3.0",
38-
"@types/webpack-env": "^1.13.3",
38+
"@types/webpack-env": "^1.13.5",
3939
"angular-mocks": "^1.6.7",
40-
"awesome-typescript-loader": "^3.4.1",
40+
"awesome-typescript-loader": "^4.0.0-0",
4141
"core-js": "^2.5.3",
4242
"coveralls": "^3.0.0",
43-
"css-loader": "^0.28.7",
44-
"extract-text-webpack-plugin": "^3.0.2",
45-
"file-loader": "^1.1.5",
46-
"html-loader": "^0.5.1",
47-
"html-webpack-plugin": "^2.30.1",
43+
"css-loader": "^0.28.11",
44+
"extract-text-webpack-plugin": "v4.0.0-beta.0",
45+
"file-loader": "^1.1.11",
46+
"html-loader": "^0.5.5",
47+
"html-webpack-plugin": "^3.0.7",
4848
"http-server": "^0.11.0",
4949
"istanbul-instrumenter-loader": "^3.0.0",
5050
"jasmine-core": "^3.0.0",
@@ -54,24 +54,25 @@
5454
"karma-jasmine": "^1.1.1",
5555
"karma-phantomjs-launcher": "^1.0.4",
5656
"karma-sourcemap-loader": "^0.3.7",
57-
"karma-webpack": "^2.0.9",
57+
"karma-webpack": "v4.0.0-beta.0",
5858
"ng-annotate-loader": "^0.6.1",
5959
"node-sass": "^4.7.2",
60-
"remap-istanbul": "^0.10.0",
60+
"remap-istanbul": "^0.10.1",
6161
"rimraf": "^2.6.2",
62-
"sass-loader": "^6.0.6",
63-
"style-loader": "^0.20.0",
64-
"tslint": "^5.8.0",
65-
"tslint-loader": "^3.5.3",
66-
"typescript": "^2.6.2",
67-
"uglifyjs-webpack-plugin": "^1.1.4",
68-
"webpack": "^3.10.0",
69-
"webpack-dev-server": "^2.10.1",
70-
"webpack-merge": "^4.1.1"
62+
"sass-loader": "^6.0.7",
63+
"style-loader": "^0.20.3",
64+
"tslint": "^5.9.1",
65+
"tslint-loader": "^3.6.0",
66+
"typescript": "^2.7.2",
67+
"uglifyjs-webpack-plugin": "^1.2.4",
68+
"webpack": "^4.2.0",
69+
"webpack-cli": "^2.0.12",
70+
"webpack-dev-server": "^3.1.1",
71+
"webpack-merge": "^4.1.2"
7172
},
7273
"dependencies": {
7374
"@uirouter/angularjs": "1.0.14",
7475
"angular": "^1.6.7",
7576
"bootstrap": "^3.3.7"
7677
}
77-
}
78+
}

webpack-dev.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const DESTINATION = path.resolve( __dirname, '.tmp' );
55

66
module.exports = webpackMerge(commonConfig, {
77
devtool: 'cheap-module-source-map',
8-
8+
mode: 'development',
99
devServer: {
1010
contentBase: path.join(__dirname, ".tmp"),
1111
compress: true,

webpack-prd.config.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const path = require('path');
2-
const webpack = require('webpack');
32
const webpackMerge = require('webpack-merge');
43
const commonConfig = require('./webpack.config.js');
54
const DESTINATION = path.resolve( __dirname, 'public' );
@@ -10,22 +9,13 @@ const DESTINATION = path.resolve( __dirname, 'public' );
109
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
1110

1211
module.exports = webpackMerge(commonConfig, {
12+
mode: 'production',
1313
output: {
1414
path: DESTINATION,
1515
filename: 'js/[name]-bundle-[chunkhash].js'
1616
},
1717

1818
plugins: [
19-
new UglifyJsPlugin(),
20-
new webpack.optimize.CommonsChunkPlugin({
21-
name: 'vendor',
22-
minChunks(module, count) {
23-
var context = module.context;
24-
return context && context.indexOf('node_modules') >= 0;
25-
},
26-
}),
27-
new webpack.optimize.CommonsChunkPlugin({
28-
name: 'manifest'
29-
}),
19+
new UglifyJsPlugin()
3020
]
3121
});

webpack-test.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ module.exports = {
1515
extensions: ['.ts', '.js']
1616
},
1717

18+
mode: 'development',
19+
1820
module: {
1921
rules: [
2022
{

webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const path = require('path');
2-
const webpack = require('webpack');
32
const ROOT = path.resolve( __dirname, 'src' );
43

54
/**

0 commit comments

Comments
 (0)