Skip to content

Commit dcb10b0

Browse files
committed
Upgrade to Webpack 4 - fix CSS import order
Signed-off-by: David Mehren <[email protected]>
1 parent a6d3ac6 commit dcb10b0

File tree

2 files changed

+36
-19
lines changed

2 files changed

+36
-19
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,15 @@
178178
"less": "^2.7.1",
179179
"less-loader": "^4.1.0",
180180
"mini-css-extract-plugin": "^0.4.1",
181-
"optimize-css-assets-webpack-plugin": "^4.0.3",
181+
"optimize-css-assets-webpack-plugin": "^5.0.0",
182182
"script-loader": "^0.7.2",
183183
"standard": "^9.0.1",
184184
"string-loader": "^0.0.1",
185185
"style-loader": "^0.21.0",
186186
"uglifyjs-webpack-plugin": "^1.2.7",
187187
"url-loader": "^1.0.1",
188188
"webpack": "^4.14.0",
189-
"webpack-cli": "^3.0.8",
189+
"webpack-cli": "^3.1.0",
190190
"webpack-parallel-uglify-plugin": "^1.1.0"
191191
},
192192
"standard": {

webpackBaseConfig.js

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ module.exports = {
2525
template: 'public/views/includes/header.ejs',
2626
chunks: ['font', 'index-styles', 'index'],
2727
filename: path.join(__dirname, 'public/views/build/index-header.ejs'),
28-
inject: false
28+
inject: false,
29+
chunksSortMode: 'manual'
2930
}),
3031
new HtmlWebpackPlugin({
3132
template: 'public/views/includes/header.ejs',
3233
chunks: ['font-pack', 'index-styles-pack', 'index-styles', 'index'],
3334
filename: path.join(__dirname, 'public/views/build/index-pack-header.ejs'),
34-
inject: false
35+
inject: false,
36+
chunksSortMode: 'manual'
3537
}),
3638
new HtmlWebpackPlugin({
3739
template: 'public/views/includes/scripts.ejs',
@@ -43,19 +45,22 @@ module.exports = {
4345
template: 'public/views/includes/scripts.ejs',
4446
chunks: ['common', 'index-pack'],
4547
filename: path.join(__dirname, 'public/views/build/index-pack-scripts.ejs'),
46-
inject: false
48+
inject: false,
49+
chunksSortMode: 'manual'
4750
}),
4851
new HtmlWebpackPlugin({
4952
template: 'public/views/includes/header.ejs',
5053
chunks: ['font', 'cover'],
5154
filename: path.join(__dirname, 'public/views/build/cover-header.ejs'),
52-
inject: false
55+
inject: false,
56+
chunksSortMode: 'manual'
5357
}),
5458
new HtmlWebpackPlugin({
5559
template: 'public/views/includes/header.ejs',
5660
chunks: ['font-pack', 'cover-styles-pack', 'cover'],
5761
filename: path.join(__dirname, 'public/views/build/cover-pack-header.ejs'),
58-
inject: false
62+
inject: false,
63+
chunksSortMode: 'manual'
5964
}),
6065
new HtmlWebpackPlugin({
6166
template: 'public/views/includes/scripts.ejs',
@@ -67,19 +72,22 @@ module.exports = {
6772
template: 'public/views/includes/scripts.ejs',
6873
chunks: ['common', 'cover-pack'],
6974
filename: path.join(__dirname, 'public/views/build/cover-pack-scripts.ejs'),
70-
inject: false
75+
inject: false,
76+
chunksSortMode: 'manual'
7177
}),
7278
new HtmlWebpackPlugin({
7379
template: 'public/views/includes/header.ejs',
7480
chunks: ['font', 'pretty-styles', 'pretty'],
7581
filename: path.join(__dirname, 'public/views/build/pretty-header.ejs'),
76-
inject: false
82+
inject: false,
83+
chunksSortMode: 'manual'
7784
}),
7885
new HtmlWebpackPlugin({
7986
template: 'public/views/includes/header.ejs',
8087
chunks: ['font-pack', 'pretty-styles-pack', 'pretty-styles', 'pretty'],
8188
filename: path.join(__dirname, 'public/views/build/pretty-pack-header.ejs'),
82-
inject: false
89+
inject: false,
90+
chunksSortMode: 'manual'
8391
}),
8492
new HtmlWebpackPlugin({
8593
template: 'public/views/includes/scripts.ejs',
@@ -91,19 +99,22 @@ module.exports = {
9199
template: 'public/views/includes/scripts.ejs',
92100
chunks: ['common', 'pretty-pack'],
93101
filename: path.join(__dirname, 'public/views/build/pretty-pack-scripts.ejs'),
94-
inject: false
102+
inject: false,
103+
chunksSortMode: 'manual'
95104
}),
96105
new HtmlWebpackPlugin({
97106
template: 'public/views/includes/header.ejs',
98107
chunks: ['font', 'slide-styles', 'slide'],
99108
filename: path.join(__dirname, 'public/views/build/slide-header.ejs'),
100-
inject: false
109+
inject: false,
110+
chunksSortMode: 'manual'
101111
}),
102112
new HtmlWebpackPlugin({
103113
template: 'public/views/includes/header.ejs',
104114
chunks: ['font-pack', 'slide-styles-pack', 'slide-styles', 'slide'],
105115
filename: path.join(__dirname, 'public/views/build/slide-pack-header.ejs'),
106-
inject: false
116+
inject: false,
117+
chunksSortMode: 'manual'
107118
}),
108119
new HtmlWebpackPlugin({
109120
template: 'public/views/includes/scripts.ejs',
@@ -420,7 +431,8 @@ module.exports = {
420431
test: require.resolve('js-sequence-diagrams'),
421432
use: [{
422433
loader: 'imports-loader',
423-
options: {_: 'lodash', Raphael: 'raphael', eve: 'eve'}}]
434+
options: {_: 'lodash', Raphael: 'raphael', eve: 'eve'}
435+
}]
424436
}, {
425437
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
426438
use: [{loader: 'file-loader'}]
@@ -431,27 +443,32 @@ module.exports = {
431443
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
432444
use: [{
433445
loader: 'url-loader',
434-
options: {prefix: 'font/', limit: '5000'}}]
446+
options: {prefix: 'font/', limit: '5000'}
447+
}]
435448
}, {
436449
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
437450
use: [{
438451
loader: 'url-loader',
439-
options: {limit: '5000', mimetype: 'application/octet-stream'}}]
452+
options: {limit: '5000', mimetype: 'application/octet-stream'}
453+
}]
440454
}, {
441455
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
442456
use: [{
443457
loader: 'url-loader',
444-
options: {limit: '10000', mimetype: 'svg+xml'}}]
458+
options: {limit: '10000', mimetype: 'svg+xml'}
459+
}]
445460
}, {
446461
test: /\.png(\?v=\d+\.\d+\.\d+)?$/,
447462
use: [{
448463
loader: 'url-loader',
449-
options: {limit: '10000', mimetype: 'image/png'}}]
464+
options: {limit: '10000', mimetype: 'image/png'}
465+
}]
450466
}, {
451467
test: /\.gif(\?v=\d+\.\d+\.\d+)?$/,
452468
use: [{
453469
loader: 'url-loader',
454-
options: {limit: '10000', mimetype: 'image/gif'}}]
470+
options: {limit: '10000', mimetype: 'image/gif'}
471+
}]
455472
}]
456473
},
457474
node: {

0 commit comments

Comments
 (0)