Skip to content

Commit ab4a0c5

Browse files
committed
Merge branch 'master' into feature/fontsource
2 parents 5090102 + f3d1afb commit ab4a0c5

21 files changed

+1171
-1227
lines changed
File renamed without changes.
File renamed without changes.

config/image-sizes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const sharp = require('sharp')
44
const Json2csvParser = require('json2csv').Parser
55
const fields = ['location', 'sizes.width', 'sizes.height', 'sizes.retina', 'sizes.ratio']
66
const dir = {
7-
conf: './src/conf-img/',
8-
tpl: './src/conf-img/tpl/',
7+
conf: './assets/conf-img/',
8+
tpl: './assets/conf-img/tpl/',
99
defaultImages: './src/img/default/',
1010
}
1111
const path = {

config/loaders.js

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,18 @@ module.exports = {
1414
/* FontsLoader */ {
1515
test: /\.(woff|woff2)$/,
1616
type: 'asset/resource',
17+
generator: {
18+
filename: 'fonts/[name][ext][query]',
19+
},
1720
},
1821
/* ImagesLoader */ {
1922
test: /\.(png|jpe?g|gif|svg)$/,
2023
type: 'asset/resource',
2124
exclude: /icons/,
2225
include: srcPath + '/img',
23-
use: [
24-
{
25-
loader: 'image-webpack-loader',
26-
options: {
27-
mozjpeg: {
28-
progressive: true,
29-
quality: 65,
30-
},
31-
pngquant: {
32-
quality: [0.65, 0.9],
33-
speed: 4,
34-
},
35-
gifsicle: {
36-
interlaced: false,
37-
},
38-
webp: {
39-
quality: 75,
40-
},
41-
},
42-
},
43-
],
26+
generator: {
27+
filename: 'images/[name][ext][query]',
28+
},
4429
},
4530
/* JSLoader */ {
4631
test: /\.js$/i,
@@ -62,6 +47,8 @@ module.exports = {
6247
{
6348
loader: 'css-loader',
6449
options: {
50+
url: true,
51+
esModule: false,
6552
importLoaders: 1,
6653
},
6754
},

config/plugins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = {
3131
new WebpackBar({
3232
color: '#ffe600',
3333
}),
34-
new DependencyExtractionWebpackPlugin({ injectPolyfill: true }),
34+
new DependencyExtractionWebpackPlugin(),
3535
]
3636

3737
if (mode === 'production') {

config/webpack.common.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const path = require('path')
22
const entries = require('./entries')
3+
const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin')
34
const TerserPlugin = require('terser-webpack-plugin')
5+
const svgoconfig = require('./svgo.config')
46

57
module.exports = {
68
entry: entries,
@@ -12,6 +14,22 @@ module.exports = {
1214
},
1315
optimization: {
1416
minimizer: [
17+
new ImageMinimizerPlugin({
18+
minimizer: {
19+
implementation: ImageMinimizerPlugin.imageminMinify,
20+
options: {
21+
// Lossless optimization with custom option
22+
// Feel free to experiment with options for better result for you
23+
plugins: [
24+
['gifsicle', { interlaced: true }],
25+
['jpegtran', { progressive: true }],
26+
['optipng', { optimizationLevel: 5 }],
27+
// Svgo configuration here https://github.com/svg/svgo#configuratio
28+
['svgo', { svgoconfig }],
29+
],
30+
},
31+
},
32+
}),
1533
new TerserPlugin({
1634
parallel: true,
1735
terserOptions: {

package.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"@fontsource/poppins": "^4.5.10",
1818
"lazysizes": "^5.3.2",
1919
"oneloop.js": "^5.0.0",
20-
"sharp": "^0.32.0",
2120
"what-input": "^5.2.10"
2221
},
2322
"devDependencies": {
@@ -36,28 +35,35 @@
3635
"eslint-config-prettier": "^8.5.0",
3736
"eslint-plugin-prettier": "^4.2.1",
3837
"eslint-webpack-plugin": "^3.2.0",
39-
"image-webpack-loader": "^7.0.1",
38+
"image-minimizer-webpack-plugin": "^3.8.2",
39+
"imagemin": "^8.0.1",
40+
"imagemin-gifsicle": "^7.0.0",
41+
"imagemin-jpegtran": "^7.0.0",
42+
"imagemin-optipng": "^8.0.0",
43+
"imagemin-svgo": "^10.0.1",
4044
"js-yaml": "^4.1.0",
4145
"json2csv": "^5.0.6",
4246
"mini-css-extract-plugin": "^1.5.0",
4347
"ora": "^5.4.0",
4448
"portfinder": "^1.0.28",
45-
"postcss": "^8.4.16",
46-
"postcss-import": "^15.0.0",
47-
"postcss-loader": "^7.0.1",
48-
"postcss-preset-env": "^7.8.0",
49+
"postcss": "^8.4.24",
50+
"postcss-import": "^15.1.0",
51+
"postcss-loader": "^7.3.2",
52+
"postcss-preset-env": "^8.4.2",
4953
"postcss-pxtorem": "^6.0.0",
50-
"postcss-scss": "^4.0.4",
51-
"postcss-sort-media-queries": "^4.2.1",
54+
"postcss-scss": "^4.0.6",
55+
"postcss-sort-media-queries": "^5.2.0",
5256
"prettier": "^2.2.1",
5357
"sass": "^1.52.3",
5458
"sass-loader": "^11.0.1",
59+
"sharp": "^0.32.1",
5560
"style-loader": "^2.0.0",
5661
"stylelint": "^14.13.0",
5762
"stylelint-config-recess-order": "^3.0.0",
5863
"stylelint-scss": "^4.3.0",
5964
"stylelint-webpack-plugin": "^3.3.0",
6065
"svg-sprite-loader": "^6.0.10",
66+
"svgo": "^3.0.2",
6167
"svgo-loader": "^3.0.0",
6268
"terser-webpack-plugin": "^5.3.6",
6369
"webpack": "^5.35.0",

0 commit comments

Comments
 (0)