Skip to content

Commit 1b9c77f

Browse files
committed
Upgrade packages and mode option
1 parent ffb9aef commit 1b9c77f

File tree

7 files changed

+2481
-892
lines changed

7 files changed

+2481
-892
lines changed

Gemfile.lock

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,53 @@ PATH
99
GEM
1010
remote: https://rubygems.org/
1111
specs:
12-
actioncable (5.1.5)
13-
actionpack (= 5.1.5)
12+
actioncable (5.1.6)
13+
actionpack (= 5.1.6)
1414
nio4r (~> 2.0)
1515
websocket-driver (~> 0.6.1)
16-
actionmailer (5.1.5)
17-
actionpack (= 5.1.5)
18-
actionview (= 5.1.5)
19-
activejob (= 5.1.5)
16+
actionmailer (5.1.6)
17+
actionpack (= 5.1.6)
18+
actionview (= 5.1.6)
19+
activejob (= 5.1.6)
2020
mail (~> 2.5, >= 2.5.4)
2121
rails-dom-testing (~> 2.0)
22-
actionpack (5.1.5)
23-
actionview (= 5.1.5)
24-
activesupport (= 5.1.5)
22+
actionpack (5.1.6)
23+
actionview (= 5.1.6)
24+
activesupport (= 5.1.6)
2525
rack (~> 2.0)
2626
rack-test (>= 0.6.3)
2727
rails-dom-testing (~> 2.0)
2828
rails-html-sanitizer (~> 1.0, >= 1.0.2)
29-
actionview (5.1.5)
30-
activesupport (= 5.1.5)
29+
actionview (5.1.6)
30+
activesupport (= 5.1.6)
3131
builder (~> 3.1)
3232
erubi (~> 1.4)
3333
rails-dom-testing (~> 2.0)
3434
rails-html-sanitizer (~> 1.0, >= 1.0.3)
35-
activejob (5.1.5)
36-
activesupport (= 5.1.5)
35+
activejob (5.1.6)
36+
activesupport (= 5.1.6)
3737
globalid (>= 0.3.6)
38-
activemodel (5.1.5)
39-
activesupport (= 5.1.5)
40-
activerecord (5.1.5)
41-
activemodel (= 5.1.5)
42-
activesupport (= 5.1.5)
38+
activemodel (5.1.6)
39+
activesupport (= 5.1.6)
40+
activerecord (5.1.6)
41+
activemodel (= 5.1.6)
42+
activesupport (= 5.1.6)
4343
arel (~> 8.0)
44-
activesupport (5.1.5)
44+
activesupport (5.1.6)
4545
concurrent-ruby (~> 1.0, >= 1.0.2)
46-
i18n (~> 0.7)
46+
i18n (>= 0.7, < 2)
4747
minitest (~> 5.1)
4848
tzinfo (~> 1.1)
4949
arel (8.0.0)
5050
ast (2.4.0)
5151
builder (3.2.3)
52-
byebug (10.0.0)
52+
byebug (10.0.2)
5353
concurrent-ruby (1.0.5)
5454
crass (1.0.3)
5555
erubi (1.7.1)
5656
globalid (0.4.1)
5757
activesupport (>= 4.2.0)
58-
i18n (0.9.5)
58+
i18n (1.0.0)
5959
concurrent-ruby (~> 1.0)
6060
loofah (2.2.2)
6161
crass (~> 1.0.2)
@@ -66,44 +66,44 @@ GEM
6666
mini_mime (1.0.0)
6767
mini_portile2 (2.3.0)
6868
minitest (5.11.3)
69-
nio4r (2.2.0)
69+
nio4r (2.3.0)
7070
nokogiri (1.8.2)
7171
mini_portile2 (~> 2.3.0)
7272
parallel (1.12.1)
73-
parser (2.5.0.3)
73+
parser (2.5.0.5)
7474
ast (~> 2.4.0)
7575
powerpack (0.1.1)
7676
rack (2.0.4)
7777
rack-proxy (0.6.4)
7878
rack
79-
rack-test (0.8.3)
79+
rack-test (1.0.0)
8080
rack (>= 1.0, < 3)
81-
rails (5.1.5)
82-
actioncable (= 5.1.5)
83-
actionmailer (= 5.1.5)
84-
actionpack (= 5.1.5)
85-
actionview (= 5.1.5)
86-
activejob (= 5.1.5)
87-
activemodel (= 5.1.5)
88-
activerecord (= 5.1.5)
89-
activesupport (= 5.1.5)
81+
rails (5.1.6)
82+
actioncable (= 5.1.6)
83+
actionmailer (= 5.1.6)
84+
actionpack (= 5.1.6)
85+
actionview (= 5.1.6)
86+
activejob (= 5.1.6)
87+
activemodel (= 5.1.6)
88+
activerecord (= 5.1.6)
89+
activesupport (= 5.1.6)
9090
bundler (>= 1.3.0)
91-
railties (= 5.1.5)
91+
railties (= 5.1.6)
9292
sprockets-rails (>= 2.0.0)
9393
rails-dom-testing (2.0.3)
9494
activesupport (>= 4.2.0)
9595
nokogiri (>= 1.6)
96-
rails-html-sanitizer (1.0.3)
97-
loofah (~> 2.0)
98-
railties (5.1.5)
99-
actionpack (= 5.1.5)
100-
activesupport (= 5.1.5)
96+
rails-html-sanitizer (1.0.4)
97+
loofah (~> 2.2, >= 2.2.2)
98+
railties (5.1.6)
99+
actionpack (= 5.1.6)
100+
activesupport (= 5.1.6)
101101
method_source
102102
rake (>= 0.8.7)
103103
thor (>= 0.18.1, < 2.0)
104104
rainbow (3.0.0)
105-
rake (12.3.0)
106-
rubocop (0.53.0)
105+
rake (12.3.1)
106+
rubocop (0.54.0)
107107
parallel (~> 1.10)
108108
parser (>= 2.5)
109109
powerpack (~> 0.1)

package.json

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,38 @@
1313
},
1414
"dependencies": {
1515
"babel-core": "^6.26.0",
16-
"babel-loader": "^7.1.2",
16+
"babel-loader": "^7.1.3",
1717
"babel-plugin-syntax-dynamic-import": "^6.18.0",
1818
"babel-plugin-transform-class-properties": "^6.24.1",
1919
"babel-plugin-transform-object-rest-spread": "^6.26.0",
2020
"babel-polyfill": "^6.26.0",
2121
"babel-preset-env": "^1.6.1",
22-
"case-sensitive-paths-webpack-plugin": "^2.1.1",
23-
"compression-webpack-plugin": "^1.1.10",
24-
"css-loader": "^0.28.9",
25-
"extract-text-webpack-plugin": "^3.0.2",
26-
"file-loader": "^1.1.6",
22+
"case-sensitive-paths-webpack-plugin": "^2.1.2",
23+
"compression-webpack-plugin": "^1.1.11",
24+
"css-loader": "^0.28.11",
25+
"file-loader": "^1.1.11",
2726
"glob": "^7.1.2",
28-
"js-yaml": "^3.10.0",
29-
"node-sass": "^4.7.2",
27+
"js-yaml": "^3.11.0",
28+
"mini-css-extract-plugin": "^0.4.0",
29+
"node-sass": "^4.8.3",
3030
"path-complete-extname": "^1.0.0",
3131
"postcss-cssnext": "^3.1.0",
32-
"postcss-import": "^11.0.0",
33-
"postcss-loader": "^2.1.0",
34-
"sass-loader": "^6.0.6",
35-
"style-loader": "^0.20.1",
36-
"uglifyjs-webpack-plugin": "^1.1.8",
37-
"webpack": "^3.10.0",
38-
"webpack-manifest-plugin": "^1.3.2"
32+
"postcss-import": "^11.1.0",
33+
"postcss-loader": "^2.1.3",
34+
"sass-loader": "^6.0.7",
35+
"style-loader": "^0.20.3",
36+
"uglifyjs-webpack-plugin": "^1.2.4",
37+
"webpack": "^4.4.1",
38+
"webpack-assets-manifest": "^3.0.0",
39+
"webpack-cli": "^2.0.13"
3940
},
4041
"devDependencies": {
41-
"eslint": "^4.17.0",
42+
"eslint": "^4.18.2",
4243
"eslint-config-airbnb": "^16.1.0",
43-
"eslint-plugin-import": "^2.8.0",
44+
"eslint-plugin-import": "^2.9.0",
4445
"eslint-plugin-jsx-a11y": "^6.0.3",
45-
"eslint-plugin-react": "^7.6.1",
46-
"jest": "^22.2.1"
46+
"eslint-plugin-react": "^7.7.0",
47+
"jest": "^22.4.2"
4748
},
4849
"jest": {
4950
"testRegex": "(/__tests__/.*|(\\.|/))\\.jsx?$",

package/environments/base.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const { sync } = require('glob')
88
const extname = require('path-complete-extname')
99

1010
const webpack = require('webpack')
11-
const ExtractTextPlugin = require('extract-text-webpack-plugin')
12-
const ManifestPlugin = require('webpack-manifest-plugin')
11+
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
12+
const WebpackAssetsManifest = require('webpack-assets-manifest')
1313
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin')
1414

1515
const { ConfigList, ConfigObject } = require('../config_types')
@@ -24,10 +24,27 @@ const getLoaderList = () => {
2424

2525
const getPluginList = () => {
2626
const result = new ConfigList()
27-
result.append('Environment', new webpack.EnvironmentPlugin(JSON.parse(JSON.stringify(process.env))))
27+
result.append(
28+
'Environment',
29+
new webpack.EnvironmentPlugin(JSON.parse(JSON.stringify(process.env)))
30+
)
2831
result.append('CaseSensitivePaths', new CaseSensitivePathsPlugin())
29-
result.append('ExtractText', new ExtractTextPlugin('[name]-[contenthash].css'))
30-
result.append('Manifest', new ManifestPlugin({ publicPath: config.publicPath, writeToFileEmit: true }))
32+
result.append(
33+
'ExtractText',
34+
new MiniCssExtractPlugin({
35+
filename: '[name]-[contenthash:8].css',
36+
chunkFilename: '[name]-[contenthash:8].chunk.css'
37+
})
38+
)
39+
result.append(
40+
'Manifest',
41+
new WebpackAssetsManifest({
42+
writeToDisk: true,
43+
publicPath: true,
44+
integrity: true,
45+
merge: true
46+
})
47+
)
3148
return result
3249
}
3350

@@ -61,9 +78,11 @@ const getModulePaths = () => {
6178

6279
const getBaseConfig = () =>
6380
new ConfigObject({
81+
mode: 'production',
6482
output: {
6583
filename: '[name]-[chunkhash].js',
6684
chunkFilename: '[name]-[chunkhash].chunk.js',
85+
hotUpdateChunkFilename: '[id]-[hash].hot-update.js',
6786
path: config.outputPath,
6887
publicPath: config.publicPath
6988
},

package/environments/development.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ module.exports = class extends Base {
1010
if (devServer.hmr) {
1111
this.plugins.append('HotModuleReplacement', new webpack.HotModuleReplacementPlugin())
1212
this.plugins.append('NamedModules', new webpack.NamedModulesPlugin())
13+
this.config.mode = 'development'
1314
this.config.output.filename = '[name]-[hash].js'
1415
}
1516

1617
this.config.merge({
18+
mode: 'development',
1719
devtool: 'cheap-module-source-map',
1820
output: {
1921
pathinfo: true

package/environments/production.js

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,11 @@
1-
const webpack = require('webpack')
2-
const CompressionPlugin = require('compression-webpack-plugin')
31
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
2+
const CompressionPlugin = require('compression-webpack-plugin')
43
const Base = require('./base')
54

65
module.exports = class extends Base {
76
constructor() {
87
super()
98

10-
this.plugins.append('ModuleConcatenation', new webpack.optimize.ModuleConcatenationPlugin())
11-
12-
this.plugins.append(
13-
'UglifyJs',
14-
new UglifyJsPlugin({
15-
parallel: true,
16-
cache: true,
17-
sourceMap: true,
18-
uglifyOptions: {
19-
ie8: false,
20-
ecma: 8,
21-
warnings: false,
22-
mangle: {
23-
safari10: true
24-
},
25-
compress: {
26-
warnings: false,
27-
comparisons: false
28-
},
29-
output: {
30-
ascii_only: true
31-
}
32-
}
33-
})
34-
)
35-
369
this.plugins.append(
3710
'Compression',
3811
new CompressionPlugin({
@@ -44,7 +17,31 @@ module.exports = class extends Base {
4417

4518
this.config.merge({
4619
devtool: 'nosources-source-map',
47-
stats: 'normal'
20+
stats: 'normal',
21+
bail: true,
22+
optimization: {
23+
minimizer: [
24+
new UglifyJsPlugin({
25+
parallel: true,
26+
cache: true,
27+
sourceMap: true,
28+
uglifyOptions: {
29+
ecma: 8,
30+
compress: {
31+
warnings: false,
32+
comparisons: false
33+
},
34+
mangle: {
35+
safari10: true
36+
},
37+
output: {
38+
comments: false,
39+
ascii_only: true
40+
}
41+
}
42+
})
43+
]
44+
}
4845
})
4946
}
5047
}

0 commit comments

Comments
 (0)