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,16 +2,16 @@ | ||
2 | * Used to package and output gzip. Note that this does not work properly in Vite, the specific reason is still being investigated | 2 | * Used to package and output gzip. Note that this does not work properly in Vite, the specific reason is still being investigated |
3 | * https://github.com/anncwb/vite-plugin-compression | 3 | * https://github.com/anncwb/vite-plugin-compression |
4 | */ | 4 | */ |
5 | -import type { Plugin } from 'vite'; | 5 | +import type { PluginOption } from 'vite'; |
6 | import compressPlugin from 'vite-plugin-compression'; | 6 | import compressPlugin from 'vite-plugin-compression'; |
7 | 7 | ||
8 | export function configCompressPlugin( | 8 | export function configCompressPlugin( |
9 | compress: 'gzip' | 'brotli' | 'none', | 9 | compress: 'gzip' | 'brotli' | 'none', |
10 | deleteOriginFile = false, | 10 | deleteOriginFile = false, |
11 | -): Plugin | Plugin[] { | 11 | +): PluginOption | PluginOption[] { |
12 | const compressList = compress.split(','); | 12 | const compressList = compress.split(','); |
13 | 13 | ||
14 | - const plugins: Plugin[] = []; | 14 | + const plugins: PluginOption[] = []; |
15 | 15 | ||
16 | if (compressList.includes('gzip')) { | 16 | if (compressList.includes('gzip')) { |
17 | plugins.push( | 17 | plugins.push( |
build/vite/plugin/html.ts
@@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
2 | * Plugin to minimize and use ejs template syntax in index.html. | 2 | * Plugin to minimize and use ejs template syntax in index.html. |
3 | * https://github.com/anncwb/vite-plugin-html | 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 | import pkg from '../../../package.json'; | 7 | import pkg from '../../../package.json'; |
8 | import { GLOB_CONFIG_FILE_NAME } from '../../constant'; | 8 | import { GLOB_CONFIG_FILE_NAME } from '../../constant'; |
9 | 9 | ||
@@ -16,7 +16,7 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) { | @@ -16,7 +16,7 @@ export function configHtmlPlugin(env: ViteEnv, isBuild: boolean) { | ||
16 | return `${path || '/'}${GLOB_CONFIG_FILE_NAME}?v=${pkg.version}-${new Date().getTime()}`; | 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 | minify: isBuild, | 20 | minify: isBuild, |
21 | inject: { | 21 | inject: { |
22 | // Inject data into ejs template | 22 | // Inject data into ejs template |
build/vite/plugin/index.ts
1 | +import { PluginOption } from 'vite'; | ||
1 | import vue from '@vitejs/plugin-vue'; | 2 | import vue from '@vitejs/plugin-vue'; |
2 | import vueJsx from '@vitejs/plugin-vue-jsx'; | 3 | import vueJsx from '@vitejs/plugin-vue-jsx'; |
3 | import legacy from '@vitejs/plugin-legacy'; | 4 | import legacy from '@vitejs/plugin-legacy'; |
@@ -24,7 +25,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { | @@ -24,7 +25,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { | ||
24 | VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE, | 25 | VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE, |
25 | } = viteEnv; | 26 | } = viteEnv; |
26 | 27 | ||
27 | - const vitePlugins = [ | 28 | + const vitePlugins: (PluginOption | PluginOption[])[] = [ |
28 | // have to | 29 | // have to |
29 | vue(), | 30 | vue(), |
30 | // have to | 31 | // have to |
build/vite/plugin/styleImport.ts
@@ -2,13 +2,13 @@ | @@ -2,13 +2,13 @@ | ||
2 | * Introduces component library styles on demand. | 2 | * Introduces component library styles on demand. |
3 | * https://github.com/anncwb/vite-plugin-style-import | 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 | export function configStyleImportPlugin(_isBuild: boolean) { | 7 | export function configStyleImportPlugin(_isBuild: boolean) { |
8 | // if (!isBuild) { | 8 | // if (!isBuild) { |
9 | // return []; | 9 | // return []; |
10 | // } | 10 | // } |
11 | - const styleImportPlugin = styleImport({ | 11 | + const styleImportPlugin = createStyleImportPlugin({ |
12 | libs: [ | 12 | libs: [ |
13 | { | 13 | { |
14 | libraryName: 'ant-design-vue', | 14 | libraryName: 'ant-design-vue', |
build/vite/plugin/svgSprite.ts
@@ -3,11 +3,11 @@ | @@ -3,11 +3,11 @@ | ||
3 | * https://github.com/anncwb/vite-plugin-svg-icons | 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 | import path from 'path'; | 7 | import path from 'path'; |
8 | 8 | ||
9 | export function configSvgIconsPlugin(isBuild: boolean) { | 9 | export function configSvgIconsPlugin(isBuild: boolean) { |
10 | - const svgIconsPlugin = SvgIconsPlugin({ | 10 | + const svgIconsPlugin = createSvgIconsPlugin({ |
11 | iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')], | 11 | iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')], |
12 | svgoOptions: isBuild, | 12 | svgoOptions: isBuild, |
13 | // default | 13 | // default |
build/vite/plugin/theme.ts
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * Vite plugin for website theme color switching | 2 | * Vite plugin for website theme color switching |
3 | * https://github.com/anncwb/vite-plugin-theme | 3 | * https://github.com/anncwb/vite-plugin-theme |
4 | */ | 4 | */ |
5 | -import type { Plugin } from 'vite'; | 5 | +import type { PluginOption } from 'vite'; |
6 | import path from 'path'; | 6 | import path from 'path'; |
7 | import { | 7 | import { |
8 | viteThemePlugin, | 8 | viteThemePlugin, |
@@ -14,7 +14,7 @@ import { | @@ -14,7 +14,7 @@ import { | ||
14 | import { getThemeColors, generateColors } from '../../config/themeConfig'; | 14 | import { getThemeColors, generateColors } from '../../config/themeConfig'; |
15 | import { generateModifyVars } from '../../generate/generateModifyVars'; | 15 | import { generateModifyVars } from '../../generate/generateModifyVars'; |
16 | 16 | ||
17 | -export function configThemePlugin(isBuild: boolean): Plugin[] { | 17 | +export function configThemePlugin(isBuild: boolean): PluginOption[] { |
18 | const colors = generateColors({ | 18 | const colors = generateColors({ |
19 | mixDarken, | 19 | mixDarken, |
20 | mixLighten, | 20 | mixLighten, |
@@ -85,5 +85,5 @@ export function configThemePlugin(isBuild: boolean): Plugin[] { | @@ -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,117 +35,118 @@ | ||
35 | "dependencies": { | 35 | "dependencies": { |
36 | "@ant-design/colors": "^6.0.0", | 36 | "@ant-design/colors": "^6.0.0", |
37 | "@ant-design/icons-vue": "^6.0.1", | 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 | "cropperjs": "^1.5.12", | 49 | "cropperjs": "^1.5.12", |
50 | "crypto-js": "^4.1.1", | 50 | "crypto-js": "^4.1.1", |
51 | "dayjs": "^1.10.7", | 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 | "lodash-es": "^4.17.21", | 54 | "lodash-es": "^4.17.21", |
55 | "mockjs": "^1.1.0", | 55 | "mockjs": "^1.1.0", |
56 | "nprogress": "^0.2.0", | 56 | "nprogress": "^0.2.0", |
57 | "path-to-regexp": "^6.2.0", | 57 | "path-to-regexp": "^6.2.0", |
58 | - "pinia": "2.0.9", | 58 | + "pinia": "2.0.11", |
59 | "print-js": "^1.6.0", | 59 | "print-js": "^1.6.0", |
60 | "qrcode": "^1.5.0", | 60 | "qrcode": "^1.5.0", |
61 | "qs": "^6.10.3", | 61 | "qs": "^6.10.3", |
62 | "resize-observer-polyfill": "^1.5.1", | 62 | "resize-observer-polyfill": "^1.5.1", |
63 | - "showdown": "^1.9.1", | 63 | + "showdown": "^2.0.0", |
64 | "sortablejs": "^1.14.0", | 64 | "sortablejs": "^1.14.0", |
65 | - "tinymce": "^5.10.2", | 65 | + "tinymce": "^5.10.3", |
66 | "vditor": "^3.8.11", | 66 | "vditor": "^3.8.11", |
67 | - "vue": "^3.2.29", | 67 | + "vue": "^3.2.31", |
68 | "vue-i18n": "^9.1.9", | 68 | "vue-i18n": "^9.1.9", |
69 | - "vue-json-pretty": "^1.8.2", | 69 | + "vue-json-pretty": "^2.0.6", |
70 | "vue-router": "^4.0.12", | 70 | "vue-router": "^4.0.12", |
71 | "vue-types": "^4.1.1", | 71 | "vue-types": "^4.1.1", |
72 | - "xlsx": "^0.17.5" | 72 | + "xlsx": "^0.18.2" |
73 | }, | 73 | }, |
74 | "devDependencies": { | 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 | "@types/codemirror": "^5.60.5", | 79 | "@types/codemirror": "^5.60.5", |
80 | - "@types/crypto-js": "^4.1.0", | 80 | + "@types/crypto-js": "^4.1.1", |
81 | "@types/fs-extra": "^9.0.13", | 81 | "@types/fs-extra": "^9.0.13", |
82 | - "@types/inquirer": "^8.1.3", | 82 | + "@types/inquirer": "^8.2.0", |
83 | "@types/intro.js": "^3.0.2", | 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 | "@types/mockjs": "^1.0.6", | 86 | "@types/mockjs": "^1.0.6", |
87 | - "@types/node": "^17.0.10", | 87 | + "@types/node": "^17.0.21", |
88 | "@types/nprogress": "^0.2.0", | 88 | "@types/nprogress": "^0.2.0", |
89 | "@types/qrcode": "^1.4.2", | 89 | "@types/qrcode": "^1.4.2", |
90 | "@types/qs": "^6.9.7", | 90 | "@types/qs": "^6.9.7", |
91 | "@types/showdown": "^1.9.4", | 91 | "@types/showdown": "^1.9.4", |
92 | "@types/sortablejs": "^1.10.7", | 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 | "@vue/test-utils": "^2.0.0-rc.18", | 99 | "@vue/test-utils": "^2.0.0-rc.18", |
100 | "autoprefixer": "^10.4.2", | 100 | "autoprefixer": "^10.4.2", |
101 | "commitizen": "^4.2.4", | 101 | "commitizen": "^4.2.4", |
102 | "conventional-changelog-cli": "^2.2.2", | 102 | "conventional-changelog-cli": "^2.2.2", |
103 | "cross-env": "^7.0.3", | 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 | "eslint-plugin-prettier": "^4.0.0", | 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 | "husky": "^7.0.4", | 113 | "husky": "^7.0.4", |
114 | "inquirer": "^8.2.0", | 114 | "inquirer": "^8.2.0", |
115 | - "jest": "^27.4.7", | 115 | + "jest": "^27.5.1", |
116 | "less": "^4.1.2", | 116 | "less": "^4.1.2", |
117 | - "lint-staged": "12.3.1", | 117 | + "lint-staged": "12.3.4", |
118 | "npm-run-all": "^4.1.5", | 118 | "npm-run-all": "^4.1.5", |
119 | - "postcss": "^8.4.5", | 119 | + "postcss": "^8.4.7", |
120 | "postcss-html": "^1.3.0", | 120 | "postcss-html": "^1.3.0", |
121 | "postcss-less": "^6.0.0", | 121 | "postcss-less": "^6.0.0", |
122 | "prettier": "^2.5.1", | 122 | "prettier": "^2.5.1", |
123 | "rimraf": "^3.0.2", | 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 | "stylelint-config-html": "^1.0.0", | 127 | "stylelint-config-html": "^1.0.0", |
127 | "stylelint-config-prettier": "^9.0.3", | 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 | "stylelint-order": "^5.0.0", | 131 | "stylelint-order": "^5.0.0", |
131 | "ts-jest": "^27.1.3", | 132 | "ts-jest": "^27.1.3", |
132 | - "ts-node": "^10.4.0", | 133 | + "ts-node": "^10.5.0", |
133 | "typescript": "^4.5.5", | 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 | "vite-plugin-mock": "^2.9.6", | 140 | "vite-plugin-mock": "^2.9.6", |
140 | - "vite-plugin-purge-icons": "^0.7.0", | 141 | + "vite-plugin-purge-icons": "^0.8.0", |
141 | "vite-plugin-pwa": "^0.11.13", | 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 | "vite-plugin-theme": "^0.8.1", | 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 | "resolutions": { | 151 | "resolutions": { |
151 | "bin-wrapper": "npm:bin-wrapper-china", | 152 | "bin-wrapper": "npm:bin-wrapper-china", |