Skip to content

Commit ee2bc19

Browse files
committed
chore: upgrade to webpack4
1 parent 26358ed commit ee2bc19

File tree

3 files changed

+1824
-204
lines changed

3 files changed

+1824
-204
lines changed

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,37 +61,37 @@
6161
"license": "MIT",
6262
"devDependencies": {
6363
"@types/chai": "^4.1.2",
64-
"@types/node": "^9.4.6",
64+
"@types/node": "^9.4.7",
6565
"@types/shelljs": "^0.7.8",
6666
"@types/sinon": "^4.3.0",
6767
"@types/sinon-chai": "^2.7.29",
68-
"awesome-typescript-loader": "^4.0.0",
6968
"chai": "^4.1.2",
7069
"coveralls": "^3.0.0",
7170
"css-loader": "^0.28.10",
72-
"extract-text-webpack-plugin": "^3.0.2",
73-
"happypack": "^4.0.1",
74-
"html-webpack-plugin": "^3.0.4",
71+
"extract-text-webpack-plugin": "^4.0.0-beta.0",
72+
"html-webpack-plugin": "^3.0.6",
7573
"madge": "^3.0.1",
7674
"moment": "^2.21.0",
77-
"node-watch": "^0.5.7",
75+
"node-watch": "^0.5.8",
7876
"npm-run-all": "^4.1.2",
7977
"nyc": "^11.4.1",
8078
"raw-loader": "^0.5.1",
8179
"rxjs": "^5.5.6",
8280
"shelljs": "^0.8.1",
8381
"shx": "^0.2.2",
8482
"sinon": "^4.4.2",
85-
"sinon-chai": "^2.14.0",
83+
"sinon-chai": "^3.0.0",
8684
"source-map-loader": "^0.2.3",
87-
"style-loader": "^0.20.2",
85+
"style-loader": "^0.20.3",
8886
"tman": "^1.7.4",
87+
"ts-loader": "^4.0.1",
8988
"ts-node": "^5.0.1",
9089
"tslint": "^5.9.1",
9190
"tslint-eslint-rules": "^5.1.0",
9291
"tslint-loader": "^3.6.0",
9392
"typescript": "^2.7.2",
94-
"webpack": "^4.1.0",
93+
"webpack": "^4.1.1",
94+
"webpack-cli": "^2.0.10",
9595
"webpack-dev-server": "^3.1.0"
9696
},
9797
"dependencies": {

webpack.config.js

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ const path = require('path')
33
const os = require('os')
44
const ExtractTextPlugin = require('extract-text-webpack-plugin')
55
const HtmlWebpackPlugin = require('html-webpack-plugin')
6-
const HappyPack = require('happypack')
7-
const { CheckerPlugin } = require('awesome-typescript-loader')
8-
9-
const happyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length })
106

117
// Webpack Config
128
module.exports = {
@@ -51,11 +47,9 @@ module.exports = {
5147
},
5248

5349
plugins: [
54-
new CheckerPlugin(),
5550
new webpack.LoaderOptionsPlugin({
5651
debug: true
5752
}),
58-
new webpack.optimize.CommonsChunkPlugin({ name: ['main', 'vendor'], minChunks: Infinity }),
5953
new ExtractTextPlugin({ filename: 'style.css' }),
6054
new webpack.HotModuleReplacementPlugin(),
6155
new webpack.NoEmitOnErrorsPlugin(),
@@ -69,25 +63,10 @@ module.exports = {
6963
NODE_ENV: JSON.stringify('development')
7064
}
7165
}),
72-
new HappyPack({
73-
id: 'css',
74-
loaders: [ 'style-loader', 'css-loader' ],
75-
threadPool: happyThreadPool
76-
}),
77-
78-
new HappyPack({
79-
id: 'sourceMap',
80-
loaders: [ 'source-map-loader' ],
81-
threadPool: happyThreadPool
82-
}),
83-
84-
new HappyPack({
85-
id: 'raw',
86-
loaders: ['raw-loader'],
87-
threadPool: happyThreadPool
88-
})
8966
],
9067

68+
mode: 'development',
69+
9170
module: {
9271
noParse: [/tman\/browser\/tman\.js/, /sinon\/pkg\/sinon\.js/],
9372
rules: [
@@ -100,16 +79,16 @@ module.exports = {
10079
{
10180
test: /\.js$/,
10281
enforce: 'pre',
103-
loader: 'happypack/loader?id=sourceMap',
82+
loaders: [ 'source-map-loader' ],
10483
include: /rxjs/
10584
},
10685
{
10786
test: /\.ts$/,
108-
use: 'awesome-typescript-loader',
87+
use: 'ts-loader',
10988
exclude: /node_modules/
11089
},
111-
{ test: /\.css$/, use: 'happypack/loader?id=css' },
112-
{ test: /\.html$/, use: 'happypack/loader?id=raw' }
90+
{ test: /\.css$/, loaders: [ 'style-loader', 'css-loader' ] },
91+
{ test: /\.html$/, loaders: ['raw-loader'] },
11392
]
11493
}
11594
}

0 commit comments

Comments
 (0)