Skip to content

Commit 2cc6ba0

Browse files
committed
lock
1 parent fa93991 commit 2cc6ba0

File tree

9 files changed

+9111
-16
lines changed

9 files changed

+9111
-16
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ root = true
44

55
[*]
66
charset = utf-8
7-
end_of_line = lf
7+
end_of_line = crlf
88
indent_style = space
99
indent_size = 2
1010
trim_trailing_whitespace = true
11-
insert_final_newline = true
11+
insert_final_newline = true

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ logs/
22
npm-debug.log
33
yarn-error.log
44
node_modules/
5-
pnpm-lock.yaml
65
package-lock.json
76
yarn.lock
87
coverage/

.prettierrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
module.exports = {
2-
...require('mwts/.prettierrc.json')
2+
...require('mwts/.prettierrc.json'),
3+
// 换行符使用 lf 结尾是 可选值"<auto|lf|crlf|cr>"
4+
endOfLine: "crlf",
35
}

package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,33 @@
1212
"@midwayjs/logger": "^2.19.3",
1313
"@midwayjs/static-file": "^3.12.10",
1414
"@midwayjs/validate": "^3.12.10",
15-
"koa-connect": "^2.1.0",
16-
"pinia": "^2.1.7",
17-
"vue": "^3.3.8",
18-
"vue-router": "^4.2.5",
1915
"axios": "^0.21.4",
16+
"cross-env": "^6.0.3",
2017
"element-plus": "^2.4.2",
18+
"koa-connect": "^2.1.0",
2119
"normalize.css": "^8.0.1",
2220
"nprogress": "^0.2.0",
23-
"cross-env": "^6.0.3",
2421
"only-allow": "^1.2.1",
25-
"vite": "^2.9.16"
22+
"pinia": "^2.1.7",
23+
"vite": "^2.9.16",
24+
"vue": "^3.3.8",
25+
"vue-router": "^4.2.5"
2626
},
2727
"devDependencies": {
2828
"@midwayjs/cli": "^1.3.22",
2929
"@midwayjs/mock": "^3.12.10",
3030
"@types/jest": "^26.0.24",
3131
"@types/koa": "^2.13.11",
3232
"@types/node": "14",
33+
"@vitejs/plugin-vue": "^2.3.4",
3334
"jest": "^26.6.3",
3435
"mwts": "^1.3.0",
36+
"rollup-plugin-analyzer": "^4.0.0",
37+
"sass": "^1.69.5",
3538
"ts-jest": "^26.5.6",
3639
"typescript": "~4.6.4",
37-
"@vitejs/plugin-vue": "^2.3.4",
38-
"vue-tsc": "^0.34.17",
39-
"rollup-plugin-analyzer": "^4.0.0",
40-
"sass": "^1.69.5"
40+
"vite-plugin-compression": "^0.5.1",
41+
"vue-tsc": "^0.34.17"
4142
},
4243
"engines": {
4344
"node": ">=14.18.0"

pnpm-lock.yaml

Lines changed: 9078 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/entry-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isPromise } from '@/utils/promise';
1+
import { isPromise } from '@/utils/is';
22
import settings from '@/config/settings';
33
import { createApp } from './main';
44

web/entry-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Readable } from 'stream';
22
import { Context } from '@midwayjs/koa';
33
import { RouteLocationRaw, RouteMeta } from 'vue-router';
44
import { renderToString, renderToNodeStream } from 'vue/server-renderer';
5-
import { isPromise } from '@/utils/promise';
5+
import { isPromise } from '@/utils/is';
66
import settings from '@/config/settings';
77
import { createApp } from './main';
88

File renamed without changes.

web/vite.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { resolve } from 'path';
33
import { defineConfig, Plugin } from 'vite';
44
import vue from '@vitejs/plugin-vue';
5+
import viteCompression from 'vite-plugin-compression';
56
import analyzer from 'rollup-plugin-analyzer';
67

78
// https://vitejs.dev/config/
@@ -10,6 +11,20 @@ export default defineConfig((/* { mode, command } */) => {
1011
const plugins: (Plugin | Plugin[])[] = [
1112
vue(),
1213
analyzer({ summaryOnly: true }),
14+
15+
// 构建压缩文件
16+
viteCompression({
17+
// 是否在控制台输出压缩结果,默认为 true
18+
verbose: true,
19+
// 是否禁用压缩,默认为 false
20+
disable: false,
21+
// 启用压缩的文件大小最小限制,单位字节(byte),默认为 0,1b(字节)=8bit(比特), 1KB=1024B
22+
threshold: 10240, // 即10kb以上即会压缩
23+
// 采用的压缩算法,默认是 gzip
24+
algorithm: 'gzip',
25+
// 生成的压缩包后缀
26+
ext: '.gz',
27+
}),
1328
];
1429

1530
return {

0 commit comments

Comments
 (0)