Skip to content

Commit 18e890f

Browse files
committed
Lots of major-version package upgrades
Included: * Stylelint * Webpack to version 4 * Update config, various loaders and plugins as a result * Replace extract-text-webpack-plugin with mini-css-extract-plugin * node-sass * jquery
1 parent d324017 commit 18e890f

File tree

3 files changed

+3170
-759
lines changed

3 files changed

+3170
-759
lines changed

package.json

+11-9
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,26 @@
1111
"node": ">=8.5.0"
1212
},
1313
"devDependencies": {
14+
"autoprefixer": "^8.2.0",
1415
"browser-sync": "^2.18.13",
15-
"browser-sync-webpack-plugin": "^1.2.0",
16+
"browser-sync-webpack-plugin": "^2.2.2",
1617
"clean-webpack-plugin": "^0.1.16",
1718
"css-loader": "^0.28.7",
18-
"extract-text-webpack-plugin": "^3.0.0",
19-
"file-loader": "1.1.5",
19+
"file-loader": "^1.1.11",
20+
"mini-css-extract-plugin": "^0.2.0",
2021
"node-sass": "^4.5.3",
2122
"npm-run-all": "^4.1.1",
2223
"postcss-loader": "^2.0.6",
23-
"reset-css": "^2.2.1",
24+
"reset-css": "^3.0.0",
2425
"sass-loader": "^6.0.6",
25-
"style-loader": "0.19.0",
26-
"stylelint": "^8.1.1",
26+
"style-loader": "^0.20.3",
27+
"stylelint": "^9.1.3",
2728
"stylelint-config-standard": "^18.0.0",
28-
"stylelint-order": "0.7.0",
29+
"stylelint-order": "^0.8.1",
2930
"susy": "^3.0.1",
30-
"url-loader": "0.6.2",
31-
"webpack": "^3.6.0"
31+
"url-loader": "^1.0.1",
32+
"webpack": "^4.2.0",
33+
"webpack-cli": "^2.0.13"
3234
},
3335
"dependencies": {
3436
"font-awesome": "^4.7.0",

webpack.config.js

+28-27
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const path = require('path');
22
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
33
const CleanWebpackPlugin = require('clean-webpack-plugin');
4-
const ExtractTextPlugin = require('extract-text-webpack-plugin');
4+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
55

66
module.exports = {
77
entry: {
@@ -22,30 +22,31 @@ module.exports = {
2222
{
2323
test: /\.scss$/,
2424
// include: /node_modules/,
25-
use: ExtractTextPlugin.extract({
26-
fallback: 'style-loader',
27-
use: [
28-
{
29-
loader: 'css-loader',
30-
options: {
31-
sourceMap: true
32-
}
33-
},
34-
{
35-
loader: 'postcss-loader',
36-
options: {
37-
sourceMap: true
38-
}
39-
},
40-
{
41-
loader: 'sass-loader',
42-
options: {
43-
includePaths: [ 'node_modules' ],
44-
sourceMap: true
45-
}
25+
use: [
26+
MiniCssExtractPlugin.loader,
27+
{
28+
loader: 'css-loader',
29+
options: {
30+
sourceMap: true
4631
}
47-
]
48-
})
32+
},
33+
{
34+
loader: 'postcss-loader',
35+
options: {
36+
plugins: () => [
37+
require('autoprefixer')
38+
],
39+
sourceMap: true
40+
}
41+
},
42+
{
43+
loader: 'sass-loader',
44+
options: {
45+
includePaths: [ 'node_modules' ],
46+
sourceMap: true
47+
}
48+
}
49+
],
4950
},
5051
{
5152
// Capture eot, svg, ttf, woff, and woff2
@@ -76,9 +77,9 @@ module.exports = {
7677
'distribution/styles/*.*',
7778
'distribution/fonts/*.*'
7879
]),
79-
new ExtractTextPlugin({
80-
filename: 'styles/[name].css',
81-
allChunks: true,
80+
new MiniCssExtractPlugin({
81+
filename: "styles/[name].css",
82+
chunkFilename: "styles/[id].css",
8283
}),
8384
new BrowserSyncPlugin({
8485
files: [

0 commit comments

Comments
 (0)