Skip to content

Commit f023a73

Browse files
committed
chore: upgrade libs
1 parent 50b8a80 commit f023a73

File tree

4 files changed

+31
-33
lines changed

4 files changed

+31
-33
lines changed

css-loader-config.js

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const ExtractCssChunks = require('extract-css-chunks-webpack-plugin');
2-
const findUp = require('find-up');
3-
const OptimizeCssAssetsWebpackPlugin = require('optimize-css-assets-webpack-plugin');
1+
const ExtractCssChunks = require('extract-css-chunks-webpack-plugin')
2+
const findUp = require('find-up')
3+
const OptimizeCssAssetsWebpackPlugin = require('optimize-css-assets-webpack-plugin')
44

5-
const fileExtensions = new Set();
6-
let extractCssInitialized = false;
5+
const fileExtensions = new Set()
6+
let extractCssInitialized = false
77

88
module.exports = (
99
config,
@@ -19,7 +19,7 @@ module.exports = (
1919
) => {
2020
// We have to keep a list of extensions for the splitchunk config
2121
for (const extension of extensions) {
22-
fileExtensions.add(extension);
22+
fileExtensions.add(extension)
2323
}
2424

2525
if (!isServer && config.optimization.splitChunks.cacheGroups) {
@@ -28,7 +28,7 @@ module.exports = (
2828
test: new RegExp(`\\.+(${[...fileExtensions].join('|')})$`),
2929
chunks: 'all',
3030
enforce: true
31-
};
31+
}
3232
}
3333

3434
if (!isServer && !extractCssInitialized) {
@@ -44,42 +44,42 @@ module.exports = (
4444
: 'static/chunks/[name].[contenthash:8].chunk.css',
4545
hot: dev
4646
})
47-
);
48-
extractCssInitialized = true;
47+
)
48+
extractCssInitialized = true
4949
}
5050

5151
if (!dev) {
5252
if (!Array.isArray(config.optimization.minimizer)) {
53-
config.optimization.minimizer = [];
53+
config.optimization.minimizer = []
5454
}
5555
config.optimization.minimizer.push(
5656
new OptimizeCssAssetsWebpackPlugin({
5757
cssProcessorOptions: {
5858
discardComments: { removeAll: true }
5959
}
6060
})
61-
);
61+
)
6262
}
6363

6464
const postcssConfig = findUp.sync('postcss.config.js', {
6565
cwd: config.context
66-
});
67-
let postcssLoader;
66+
})
67+
let postcssLoader
6868

6969
if (postcssConfig) {
7070
// Copy the postcss-loader config options first.
7171
const postcssOptionsConfig = Object.assign(
7272
{},
7373
postcssLoaderOptions.config,
7474
{ path: postcssConfig }
75-
);
75+
)
7676

7777
postcssLoader = {
7878
loader: 'postcss-loader',
7979
options: Object.assign({}, postcssLoaderOptions, {
8080
config: postcssOptionsConfig
8181
})
82-
};
82+
}
8383
}
8484

8585
const cssLoader = {
@@ -97,23 +97,22 @@ module.exports = (
9797
},
9898
cssLoaderOptions
9999
)
100-
};
100+
}
101101

102102
// When not using css modules we don't transpile on the server
103103
if (isServer && !cssLoader.options.modules) {
104-
return ['ignore-loader'];
104+
return ['ignore-loader']
105105
}
106106

107107
// When on the server and using css modules we transpile the css
108108
if (isServer && cssLoader.options.modules) {
109-
return [cssLoader, postcssLoader, ...loaders].filter(Boolean);
109+
return [cssLoader, postcssLoader, ...loaders].filter(Boolean)
110110
}
111111

112112
return [
113113
!isServer && dev && 'extracted-loader',
114114
!isServer && ExtractCssChunks.loader,
115115
cssLoader,
116-
postcssLoader,
117116
...loaders
118-
].filter(Boolean);
119-
};
117+
].filter(Boolean)
118+
}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = (nextConfig = {}) => {
1212
const { dev, isServer } = options
1313
const { cssLoaderOptions, postcssLoaderOptions } = nextConfig
1414

15-
const createStyleConfig = cssModules =>
15+
const createStyleConfig = (cssModules) =>
1616
(options.defaultLoaders.css = cssLoaderConfig(config, {
1717
extensions: ['css'],
1818
cssModules,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
},
1010
"dependencies": {
1111
"css-loader": "^2.1.1",
12-
"extract-css-chunks-webpack-plugin": "^4.2.0",
13-
"extracted-loader": "1.0.4",
12+
"extract-css-chunks-webpack-plugin": "^4.5.1",
13+
"extracted-loader": "^1.0.7",
1414
"find-up": "2.1.0",
1515
"ignore-loader": "0.1.2",
1616
"optimize-css-assets-webpack-plugin": "^5.0.1",

yarn.lock

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,21 +1784,20 @@ extglob@^2.0.4:
17841784
snapdragon "^0.8.1"
17851785
to-regex "^3.0.1"
17861786

1787-
extract-css-chunks-webpack-plugin@^4.2.0:
1788-
version "4.2.0"
1789-
resolved "https://registry.yarnpkg.com/extract-css-chunks-webpack-plugin/-/extract-css-chunks-webpack-plugin-4.2.0.tgz#e23bdb40cbfecfabf1affe5798b27be9625a25bc"
1790-
integrity sha512-ws8uIGdkKSa2TyDcdX70eo3uuBSHvp3hbeiqKaBHGIFEVBRWLk9gpLL09QoJN45FfgrXGl6D48NkOnhi2vuuXg==
1787+
extract-css-chunks-webpack-plugin@^4.5.1:
1788+
version "4.5.1"
1789+
resolved "https://registry.yarnpkg.com/extract-css-chunks-webpack-plugin/-/extract-css-chunks-webpack-plugin-4.5.1.tgz#b69be9d22297502ae55c77b5b8f2edf82fa47130"
1790+
integrity sha512-SMTguWPSE3nqLFhf9wVNbGg4LKSOolj2/C/WtWIKNDOh7Cc68leo/270N4HPCwwcnZs7zxw9zS+e5n1gynw1Gw==
17911791
dependencies:
17921792
loader-utils "^1.1.0"
1793-
lodash "^4.17.11"
17941793
normalize-url "^2.0.1"
17951794
schema-utils "^1.0.0"
17961795
webpack-sources "^1.1.0"
17971796

1798-
1799-
version "1.0.4"
1800-
resolved "https://registry.yarnpkg.com/extracted-loader/-/extracted-loader-1.0.4.tgz#e1a3f1791813c14091a1959e261e23e95dd90115"
1801-
integrity sha512-G8A0hT/WCWIjesZm7BwbWdST5dQ08GNnCpTrJT/k/FYzuiJwlV1gyWjnuoizOzAR4jpEYXG2J++JyEKN/EB26Q==
1797+
extracted-loader@^1.0.7:
1798+
version "1.0.7"
1799+
resolved "https://registry.yarnpkg.com/extracted-loader/-/extracted-loader-1.0.7.tgz#80ee335be54c8f45d649e3362d5ae6bb46686067"
1800+
integrity sha512-70ynm4CxHhoXkFS1TOoqIesH+xc7l0sqj8C3i9gQklkAhNZjgSafgVuRJyGmD1lROgP1Ft3z2ONP88XJbAJiow==
18021801

18031802
fast-deep-equal@^2.0.1:
18041803
version "2.0.1"

0 commit comments

Comments
 (0)