@dlzn-ui/vite-config 2.0.37 → 2.0.40
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/dist/index.mjs +35 -47
- package/package.json +2 -3
package/dist/index.mjs
CHANGED
|
@@ -18,7 +18,6 @@ import { upperFirst as upperFirst$1, camelCase, kebabCase } from 'lodash-es';
|
|
|
18
18
|
import { webUpdateNotice } from '@plugin-web-update-notification/vite';
|
|
19
19
|
import { visualizer } from 'rollup-plugin-visualizer';
|
|
20
20
|
import { compression } from 'vite-plugin-compression2';
|
|
21
|
-
import viteImagemin from 'vite-plugin-imagemin';
|
|
22
21
|
import fs from 'node:fs/promises';
|
|
23
22
|
|
|
24
23
|
const autoImportStoreList = (root) => {
|
|
@@ -310,52 +309,41 @@ const vitePlugins = (options) => {
|
|
|
310
309
|
if (isProduction) {
|
|
311
310
|
return [
|
|
312
311
|
...isCI() ? [] : [
|
|
313
|
-
viteImagemin({
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
plugins: [
|
|
349
|
-
{
|
|
350
|
-
name: "preset-default"
|
|
351
|
-
}
|
|
352
|
-
]
|
|
353
|
-
},
|
|
354
|
-
webp: {
|
|
355
|
-
quality: 80
|
|
356
|
-
// 图片质量(0-100)
|
|
357
|
-
}
|
|
358
|
-
}),
|
|
312
|
+
// (viteImagemin as unknown as typeof viteImagemin.default)({
|
|
313
|
+
// gifsicle: {
|
|
314
|
+
// // https://github.com/imagemin/imagemin-gifsicle
|
|
315
|
+
// colors: 256, // 指定 GIF 图像调色板(颜色表)的最大颜色数量, 可丢弃一些颜色达到更大的优化效果
|
|
316
|
+
// interlaced: false, // 渐进式加载效果
|
|
317
|
+
// optimizationLevel: 2, // 中的优化级别
|
|
318
|
+
// },
|
|
319
|
+
// mozjpeg: {
|
|
320
|
+
// quality: 50, // 图片质量(0-100)
|
|
321
|
+
// },
|
|
322
|
+
// optipng: {
|
|
323
|
+
// optimizationLevel: 3, // 压缩过程中尝试的优化策略和强度(0-7)
|
|
324
|
+
// },
|
|
325
|
+
// pngquant: {
|
|
326
|
+
// quality: [0.65, 0.8], // 压缩后的图片质量范围[最小, 最大]
|
|
327
|
+
// speed: 4,
|
|
328
|
+
// },
|
|
329
|
+
// svgo: {
|
|
330
|
+
// datauri: 'base64', // 'base64'|'enc'|'unenc' 指定如何将 SVG 转换为 Data URI 格式
|
|
331
|
+
// js2svg: {
|
|
332
|
+
// // 控制 SVG 输出的格式
|
|
333
|
+
// indent: 4, // 缩进空格数
|
|
334
|
+
// pretty: false, // 是否美化输出格式
|
|
335
|
+
// },
|
|
336
|
+
// multipass: false, // 是否启用多遍优化: false 表示只进行单遍优化,true 会重复优化直到无法进一步优化, 设置为 true 的话可能优化的更大
|
|
337
|
+
// plugins: [
|
|
338
|
+
// {
|
|
339
|
+
// name: 'preset-default',
|
|
340
|
+
// },
|
|
341
|
+
// ],
|
|
342
|
+
// },
|
|
343
|
+
// webp: {
|
|
344
|
+
// quality: 80, // 图片质量(0-100)
|
|
345
|
+
// },
|
|
346
|
+
// }),
|
|
359
347
|
visualizer({
|
|
360
348
|
filename: "node_modules/.cache/visualizer/report.html",
|
|
361
349
|
open: true
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dlzn-ui/vite-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.40",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -34,10 +34,9 @@
|
|
|
34
34
|
"vite-plugin-compression2": "^2.5.3",
|
|
35
35
|
"vite-plugin-env-parse": "^1.0.15",
|
|
36
36
|
"vite-plugin-html": "^3.2.2",
|
|
37
|
-
"vite-plugin-imagemin": "^0.6.1",
|
|
38
37
|
"vite-plugin-vue-tailwind-auto-reference": "^2.0.2",
|
|
39
38
|
"vue-router": "^5.2.0",
|
|
40
|
-
"@dlzn-ui/node-utils": "2.0.
|
|
39
|
+
"@dlzn-ui/node-utils": "2.0.40"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
42
|
"rimraf": "^6.1.3",
|