@qse/edu-scripts 1.14.3 → 1.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,7 @@ var CaseSensitivePathsPlugin = require("case-sensitive-paths-webpack-plugin");
|
|
|
10
10
|
var appPkg = require(paths.package);
|
|
11
11
|
var appConfig = require("../utils/appConfig");
|
|
12
12
|
var { ESBuildMinifyPlugin } = require("esbuild-loader");
|
|
13
|
+
var ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
|
|
13
14
|
var jsMainPath = appConfig.grayscale ? `${appPkg.name}/beta/${appPkg.name}` : `${appPkg.name}/${appPkg.name}`;
|
|
14
15
|
var assetPath = appConfig.grayscale ? `${appPkg.name}/beta/${appPkg.version}` : `${appPkg.name}/${appPkg.version}`;
|
|
15
16
|
var cssRegex = /\.css$/;
|
|
@@ -356,6 +357,17 @@ module.exports = function getWebpackConfig(args, override) {
|
|
|
356
357
|
optimization: {
|
|
357
358
|
minimize: isProd && override.minify !== false,
|
|
358
359
|
minimizer: [
|
|
360
|
+
override.minifyImage && new ImageMinimizerPlugin({
|
|
361
|
+
minimizer: {
|
|
362
|
+
implementation: ImageMinimizerPlugin.sharpMinify,
|
|
363
|
+
options: {
|
|
364
|
+
encodeOptions: {
|
|
365
|
+
// Your options for `sharp`
|
|
366
|
+
// https://sharp.pixelplumbing.com/api-output
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}),
|
|
359
371
|
override.minify === "esbuild" && new ESBuildMinifyPlugin({
|
|
360
372
|
pure: override.pure_funcs ?? ["console.log"],
|
|
361
373
|
drop: ["debugger"],
|
package/lib/utils/getOverride.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qse/edu-scripts",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.4",
|
|
4
4
|
"author": "Kinoko",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "教育工程化基础框架",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"@babel/plugin-proposal-decorators": "~7.23.2",
|
|
39
39
|
"@babel/plugin-transform-runtime": "~7.23.2",
|
|
40
40
|
"@babel/preset-env": "~7.23.2",
|
|
41
|
-
"@babel/preset-react": "~7.
|
|
41
|
+
"@babel/preset-react": "~7.23.2",
|
|
42
42
|
"@babel/preset-typescript": "~7.23.2",
|
|
43
|
-
"@babel/register": "~7.
|
|
43
|
+
"@babel/register": "~7.23.2",
|
|
44
44
|
"@babel/runtime": "~7.23.2",
|
|
45
45
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
46
|
-
"@qse/ssh-sftp": "^1.0.
|
|
46
|
+
"@qse/ssh-sftp": "^1.0.1",
|
|
47
47
|
"@svgr/webpack": "^8.0.1",
|
|
48
48
|
"babel-loader": "^9.1.3",
|
|
49
49
|
"babel-plugin-import": "^1.13.8",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"globby": "^11.1.0",
|
|
62
62
|
"gzip-size": "^6.0.0",
|
|
63
63
|
"html-webpack-plugin": "^5.5.3",
|
|
64
|
+
"image-minimizer-webpack-plugin": "^3.0.0",
|
|
64
65
|
"inquirer": "^8.2.5",
|
|
65
66
|
"less": "^3.13.1",
|
|
66
67
|
"less-loader": "^10.2.0",
|
|
@@ -80,6 +81,7 @@
|
|
|
80
81
|
"recursive-readdir": "^2.2.3",
|
|
81
82
|
"rimraf": "^3.0.2",
|
|
82
83
|
"semver": "^7.5.4",
|
|
84
|
+
"sharp": "^0.32.0",
|
|
83
85
|
"strip-ansi": "^6.0.1",
|
|
84
86
|
"style-loader": "^3.3.3",
|
|
85
87
|
"tailwindcss": "^3.3.3",
|
|
@@ -9,6 +9,7 @@ const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin')
|
|
|
9
9
|
const appPkg = require(paths.package)
|
|
10
10
|
const appConfig = require('../utils/appConfig')
|
|
11
11
|
const { ESBuildMinifyPlugin } = require('esbuild-loader')
|
|
12
|
+
const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
|
|
12
13
|
|
|
13
14
|
const jsMainPath = appConfig.grayscale
|
|
14
15
|
? `${appPkg.name}/beta/${appPkg.name}`
|
|
@@ -381,6 +382,17 @@ module.exports = function getWebpackConfig(args, override) {
|
|
|
381
382
|
optimization: {
|
|
382
383
|
minimize: isProd && override.minify !== false,
|
|
383
384
|
minimizer: [
|
|
385
|
+
override.minifyImage && new ImageMinimizerPlugin({
|
|
386
|
+
minimizer: {
|
|
387
|
+
implementation: ImageMinimizerPlugin.sharpMinify,
|
|
388
|
+
options: {
|
|
389
|
+
encodeOptions: {
|
|
390
|
+
// Your options for `sharp`
|
|
391
|
+
// https://sharp.pixelplumbing.com/api-output
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
}),
|
|
384
396
|
override.minify === 'esbuild' &&
|
|
385
397
|
new ESBuildMinifyPlugin({
|
|
386
398
|
pure: override.pure_funcs ?? ['console.log'],
|
package/src/utils/getOverride.js
CHANGED