Commit af6ab98945eae5c8ebe38d6900bcb9199b90a466
1 parent
ecc2135b
fix: build error
Showing
7 changed files
with
78 additions
and
76 deletions
Too many changes to show.
To preserve performance only 7 of 11 files are displayed.
build/vite/plugin/compress.ts
... | ... | @@ -2,16 +2,16 @@ |
2 | 2 | * Used to package and output gzip. Note that this does not work properly in Vite, the specific reason is still being investigated |
3 | 3 | * https://github.com/anncwb/vite-plugin-compression |
4 | 4 | */ |
5 | -import type { Plugin } from 'vite'; | |
5 | +import type { PluginOption } from 'vite'; | |
6 | 6 | import compressPlugin from 'vite-plugin-compression'; |
7 | 7 | |
8 | 8 | export function configCompressPlugin( |
9 | 9 | compress: 'gzip' | 'brotli' | 'none', |
10 | 10 | deleteOriginFile = false, |
11 | -): Plugin | Plugin[] { | |
11 | +): PluginOption | PluginOption[] { | |
12 | 12 | const compressList = compress.split(','); |
13 | 13 | |
14 | - const plugins: Plugin[] = []; | |
14 | + const plugins: PluginOption[] = []; | |
15 | 15 | |
16 | 16 | if (compressList.includes('gzip')) { |
17 | 17 | plugins.push( | ... | ... |
build/vite/plugin/html.ts
... | ... | @@ -2,8 +2,8 @@ |
2 | 2 | * Plugin to minimize and use ejs template syntax in index.html. |
3 | 3 | * https://github.com/anncwb/vite-plugin-html |
4 | 4 | */ |
5 | -import type { Plugin } from 'vite'; | |
6 | -import html from 'vite-plugin-html'; | |
5 | +import type { PluginOption } from 'vite'; | |
6 | +import { createHtmlPlugin } from 'vite-plugin-html'; | |
7 | 7 | import pkg from '../../../package.json'; |
8 | 8 | import { GLOB_CONFIG_FILE_NAME } from '../../constant'; |
9 | 9 | |
... | ... | @@ -16,7 +16,7 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) { |
16 | 16 | return `${path || '/'}${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`; |
17 | 17 | }; |
18 | 18 | |
19 | - const htmlPlugin: Plugin[] = html({ | |
19 | + const htmlPlugin: PluginOption[] = createHtmlPlugin({ | |
20 | 20 | minify: isBuild, |
21 | 21 | inject: { |
22 | 22 | // Inject data into ejs template | ... | ... |
build/vite/plugin/index.ts
1 | +import { PluginOption } from 'vite'; | |
1 | 2 | import vue from '@vitejs/plugin-vue'; |
2 | 3 | import vueJsx from '@vitejs/plugin-vue-jsx'; |
3 | 4 | import legacy from '@vitejs/plugin-legacy'; |
... | ... | @@ -24,7 +25,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { |
24 | 25 | VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE, |
25 | 26 | } = viteEnv; |
26 | 27 | |
27 | - const vitePlugins = [ | |
28 | + const vitePlugins: (PluginOption | PluginOption[])[] = [ | |
28 | 29 | // have to |
29 | 30 | vue(), |
30 | 31 | // have to | ... | ... |
build/vite/plugin/styleImport.ts
... | ... | @@ -2,13 +2,13 @@ |
2 | 2 | * Introduces component library styles on demand. |
3 | 3 | * https://github.com/anncwb/vite-plugin-style-import |
4 | 4 | */ |
5 | -import styleImport from 'vite-plugin-style-import'; | |
5 | +import { createStyleImportPlugin } from 'vite-plugin-style-import'; | |
6 | 6 | |
7 | 7 | export function configStyleImportPlugin(_isBuild: boolean) { |
8 | 8 | // if (!isBuild) { |
9 | 9 | // return []; |
10 | 10 | // } |
11 | - const styleImportPlugin = styleImport({ | |
11 | + const styleImportPlugin = createStyleImportPlugin({ | |
12 | 12 | libs: [ |
13 | 13 | { |
14 | 14 | libraryName: 'ant-design-vue', | ... | ... |
build/vite/plugin/svgSprite.ts
... | ... | @@ -3,11 +3,11 @@ |
3 | 3 | * https://github.com/anncwb/vite-plugin-svg-icons |
4 | 4 | */ |
5 | 5 | |
6 | -import SvgIconsPlugin from 'vite-plugin-svg-icons'; | |
6 | +import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'; | |
7 | 7 | import path from 'path'; |
8 | 8 | |
9 | 9 | export function configSvgIconsPlugin(isBuild: boolean) { |
10 | - const svgIconsPlugin = SvgIconsPlugin({ | |
10 | + const svgIconsPlugin = createSvgIconsPlugin({ | |
11 | 11 | iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')], |
12 | 12 | svgoOptions: isBuild, |
13 | 13 | // default | ... | ... |
build/vite/plugin/theme.ts
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | * Vite plugin for website theme color switching |
3 | 3 | * https://github.com/anncwb/vite-plugin-theme |
4 | 4 | */ |
5 | -import type { Plugin } from 'vite'; | |
5 | +import type { PluginOption } from 'vite'; | |
6 | 6 | import path from 'path'; |
7 | 7 | import { |
8 | 8 | viteThemePlugin, |
... | ... | @@ -14,7 +14,7 @@ import { |
14 | 14 | import { getThemeColors, generateColors } from '../../config/themeConfig'; |
15 | 15 | import { generateModifyVars } from '../../generate/generateModifyVars'; |
16 | 16 | |
17 | -export function configThemePlugin(isBuild: boolean): Plugin[] { | |
17 | +export function configThemePlugin(isBuild: boolean): PluginOption[] { | |
18 | 18 | const colors = generateColors({ |
19 | 19 | mixDarken, |
20 | 20 | mixLighten, |
... | ... | @@ -85,5 +85,5 @@ export function configThemePlugin(isBuild: boolean): Plugin[] { |
85 | 85 | }), |
86 | 86 | ]; |
87 | 87 | |
88 | - return plugin as unknown as Plugin[]; | |
88 | + return plugin as unknown as PluginOption[]; | |
89 | 89 | } | ... | ... |
package.json
... | ... | @@ -35,117 +35,118 @@ |
35 | 35 | "dependencies": { |
36 | 36 | "@ant-design/colors": "^6.0.0", |
37 | 37 | "@ant-design/icons-vue": "^6.0.1", |
38 | - "@iconify/iconify": "^2.1.1", | |
39 | - "@logicflow/core": "^1.0.7", | |
40 | - "@logicflow/extension": "^1.0.7", | |
41 | - "@vue/runtime-core": "^3.2.29", | |
42 | - "@vue/shared": "^3.2.29", | |
43 | - "@vueuse/core": "^7.5.4", | |
44 | - "@vueuse/shared": "^7.5.4", | |
45 | - "@zxcvbn-ts/core": "^1.2.0", | |
46 | - "ant-design-vue": "3.0.0-beta.8", | |
47 | - "axios": "^0.25.0", | |
48 | - "codemirror": "^5.65.1", | |
38 | + "@iconify/iconify": "^2.1.2", | |
39 | + "@logicflow/core": "^1.1.4", | |
40 | + "@logicflow/extension": "^1.1.4", | |
41 | + "@vue/runtime-core": "^3.2.31", | |
42 | + "@vue/shared": "^3.2.31", | |
43 | + "@vueuse/core": "^7.7.0", | |
44 | + "@vueuse/shared": "^7.7.0", | |
45 | + "@zxcvbn-ts/core": "^2.0.0", | |
46 | + "ant-design-vue": "3.0.0-beta.10", | |
47 | + "axios": "^0.26.0", | |
48 | + "codemirror": "^5.65.2", | |
49 | 49 | "cropperjs": "^1.5.12", |
50 | 50 | "crypto-js": "^4.1.1", |
51 | 51 | "dayjs": "^1.10.7", |
52 | - "echarts": "^5.2.2", | |
53 | - "intro.js": "^4.3.0", | |
52 | + "echarts": "^5.3.0", | |
53 | + "intro.js": "^5.0.0", | |
54 | 54 | "lodash-es": "^4.17.21", |
55 | 55 | "mockjs": "^1.1.0", |
56 | 56 | "nprogress": "^0.2.0", |
57 | 57 | "path-to-regexp": "^6.2.0", |
58 | - "pinia": "2.0.9", | |
58 | + "pinia": "2.0.11", | |
59 | 59 | "print-js": "^1.6.0", |
60 | 60 | "qrcode": "^1.5.0", |
61 | 61 | "qs": "^6.10.3", |
62 | 62 | "resize-observer-polyfill": "^1.5.1", |
63 | - "showdown": "^1.9.1", | |
63 | + "showdown": "^2.0.0", | |
64 | 64 | "sortablejs": "^1.14.0", |
65 | - "tinymce": "^5.10.2", | |
65 | + "tinymce": "^5.10.3", | |
66 | 66 | "vditor": "^3.8.11", |
67 | - "vue": "^3.2.29", | |
67 | + "vue": "^3.2.31", | |
68 | 68 | "vue-i18n": "^9.1.9", |
69 | - "vue-json-pretty": "^1.8.2", | |
69 | + "vue-json-pretty": "^2.0.6", | |
70 | 70 | "vue-router": "^4.0.12", |
71 | 71 | "vue-types": "^4.1.1", |
72 | - "xlsx": "^0.17.5" | |
72 | + "xlsx": "^0.18.2" | |
73 | 73 | }, |
74 | 74 | "devDependencies": { |
75 | - "@commitlint/cli": "^16.1.0", | |
76 | - "@commitlint/config-conventional": "^16.0.0", | |
77 | - "@iconify/json": "^2.0.28", | |
78 | - "@purge-icons/generated": "^0.7.0", | |
75 | + "@commitlint/cli": "^16.2.1", | |
76 | + "@commitlint/config-conventional": "^16.2.1", | |
77 | + "@iconify/json": "^2.1.7", | |
78 | + "@purge-icons/generated": "^0.8.0", | |
79 | 79 | "@types/codemirror": "^5.60.5", |
80 | - "@types/crypto-js": "^4.1.0", | |
80 | + "@types/crypto-js": "^4.1.1", | |
81 | 81 | "@types/fs-extra": "^9.0.13", |
82 | - "@types/inquirer": "^8.1.3", | |
82 | + "@types/inquirer": "^8.2.0", | |
83 | 83 | "@types/intro.js": "^3.0.2", |
84 | - "@types/jest": "^27.4.0", | |
85 | - "@types/lodash-es": "^4.17.5", | |
84 | + "@types/jest": "^27.4.1", | |
85 | + "@types/lodash-es": "^4.17.6", | |
86 | 86 | "@types/mockjs": "^1.0.6", |
87 | - "@types/node": "^17.0.10", | |
87 | + "@types/node": "^17.0.21", | |
88 | 88 | "@types/nprogress": "^0.2.0", |
89 | 89 | "@types/qrcode": "^1.4.2", |
90 | 90 | "@types/qs": "^6.9.7", |
91 | 91 | "@types/showdown": "^1.9.4", |
92 | 92 | "@types/sortablejs": "^1.10.7", |
93 | - "@typescript-eslint/eslint-plugin": "^5.10.0", | |
94 | - "@typescript-eslint/parser": "^5.10.0", | |
95 | - "@vitejs/plugin-legacy": "^1.6.4", | |
96 | - "@vitejs/plugin-vue": "^2.1.0", | |
97 | - "@vitejs/plugin-vue-jsx": "^1.3.3", | |
98 | - "@vue/compiler-sfc": "3.2.29", | |
93 | + "@typescript-eslint/eslint-plugin": "^5.12.1", | |
94 | + "@typescript-eslint/parser": "^5.12.1", | |
95 | + "@vitejs/plugin-legacy": "^1.7.1", | |
96 | + "@vitejs/plugin-vue": "^2.2.2", | |
97 | + "@vitejs/plugin-vue-jsx": "^1.3.7", | |
98 | + "@vue/compiler-sfc": "3.2.31", | |
99 | 99 | "@vue/test-utils": "^2.0.0-rc.18", |
100 | 100 | "autoprefixer": "^10.4.2", |
101 | 101 | "commitizen": "^4.2.4", |
102 | 102 | "conventional-changelog-cli": "^2.2.2", |
103 | 103 | "cross-env": "^7.0.3", |
104 | - "dotenv": "^14.2.0", | |
105 | - "eslint": "^8.7.0", | |
106 | - "eslint-config-prettier": "^8.3.0", | |
107 | - "eslint-define-config": "^1.2.3", | |
108 | - "eslint-plugin-jest": "^25.7.0", | |
104 | + "dotenv": "^16.0.0", | |
105 | + "eslint": "^8.10.0", | |
106 | + "eslint-config-prettier": "^8.4.0", | |
107 | + "eslint-define-config": "^1.2.5", | |
108 | + "eslint-plugin-jest": "^26.1.1", | |
109 | 109 | "eslint-plugin-prettier": "^4.0.0", |
110 | - "eslint-plugin-vue": "^8.3.0", | |
111 | - "esno": "^0.14.0", | |
112 | - "fs-extra": "^10.0.0", | |
110 | + "eslint-plugin-vue": "^8.5.0", | |
111 | + "esno": "^0.14.1", | |
112 | + "fs-extra": "^10.0.1", | |
113 | 113 | "husky": "^7.0.4", |
114 | 114 | "inquirer": "^8.2.0", |
115 | - "jest": "^27.4.7", | |
115 | + "jest": "^27.5.1", | |
116 | 116 | "less": "^4.1.2", |
117 | - "lint-staged": "12.3.1", | |
117 | + "lint-staged": "12.3.4", | |
118 | 118 | "npm-run-all": "^4.1.5", |
119 | - "postcss": "^8.4.5", | |
119 | + "postcss": "^8.4.7", | |
120 | 120 | "postcss-html": "^1.3.0", |
121 | 121 | "postcss-less": "^6.0.0", |
122 | 122 | "prettier": "^2.5.1", |
123 | 123 | "rimraf": "^3.0.2", |
124 | - "rollup-plugin-visualizer": "^5.5.4", | |
125 | - "stylelint": "^14.3.0", | |
124 | + "rollup": "^2.68.0", | |
125 | + "rollup-plugin-visualizer": "^5.6.0", | |
126 | + "stylelint": "^14.5.3", | |
126 | 127 | "stylelint-config-html": "^1.0.0", |
127 | 128 | "stylelint-config-prettier": "^9.0.3", |
128 | - "stylelint-config-recommended": "^6.0.0", | |
129 | - "stylelint-config-standard": "^24.0.0", | |
129 | + "stylelint-config-recommended": "^7.0.0", | |
130 | + "stylelint-config-standard": "^25.0.0", | |
130 | 131 | "stylelint-order": "^5.0.0", |
131 | 132 | "ts-jest": "^27.1.3", |
132 | - "ts-node": "^10.4.0", | |
133 | + "ts-node": "^10.5.0", | |
133 | 134 | "typescript": "^4.5.5", |
134 | - "vite": "^2.8.0-beta.3", | |
135 | - "vite-plugin-compression": "^0.4.0", | |
136 | - "vite-plugin-html": "^2.1.2", | |
137 | - "vite-plugin-imagemin": "^0.5.2", | |
138 | - "vite-plugin-mkcert": "^1.5.2", | |
135 | + "vite": "^2.8.4", | |
136 | + "vite-plugin-compression": "^0.5.1", | |
137 | + "vite-plugin-html": "^3.1.0", | |
138 | + "vite-plugin-imagemin": "^0.6.1", | |
139 | + "vite-plugin-mkcert": "^1.6.0", | |
139 | 140 | "vite-plugin-mock": "^2.9.6", |
140 | - "vite-plugin-purge-icons": "^0.7.0", | |
141 | + "vite-plugin-purge-icons": "^0.8.0", | |
141 | 142 | "vite-plugin-pwa": "^0.11.13", |
142 | - "vite-plugin-style-import": "^1.4.1", | |
143 | - "vite-plugin-svg-icons": "^1.1.0", | |
143 | + "vite-plugin-style-import": "^2.0.0", | |
144 | + "vite-plugin-svg-icons": "^2.0.1", | |
144 | 145 | "vite-plugin-theme": "^0.8.1", |
145 | - "vite-plugin-vue-setup-extend": "^0.3.0", | |
146 | - "vite-plugin-windicss": "^1.6.3", | |
147 | - "vue-eslint-parser": "^8.2.0", | |
148 | - "vue-tsc": "^0.31.1" | |
146 | + "vite-plugin-vue-setup-extend": "^0.4.0", | |
147 | + "vite-plugin-windicss": "^1.8.1", | |
148 | + "vue-eslint-parser": "^8.3.0", | |
149 | + "vue-tsc": "^0.32.0" | |
149 | 150 | }, |
150 | 151 | "resolutions": { |
151 | 152 | "bin-wrapper": "npm:bin-wrapper-china", | ... | ... |