Skip to content

Commit d1cbc72

Browse files
committed
fix: resolve antdv build warning
1 parent 013dc0b commit d1cbc72

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@
4141
"xterm-addon-fit": "^0.8.0"
4242
},
4343
"devDependencies": {
44+
"@antfu/eslint-config-vue": "^0.43.1",
4445
"@types/lodash": "^4.14.202",
4546
"@types/nprogress": "^0.2.0",
4647
"@types/sortablejs": "^1.15.0",
47-
"@vue/tsconfig": "^0.4.0",
48-
"@antfu/eslint-config-vue": "^0.43.1",
4948
"@typescript-eslint/eslint-plugin": "^6.13.0",
5049
"@typescript-eslint/parser": "^6.13.0",
5150
"@vitejs/plugin-vue": "^4.5.0",
5251
"@vitejs/plugin-vue-jsx": "^3.1.0",
5352
"@vue/compiler-sfc": "^3.3.10",
53+
"@vue/tsconfig": "^0.4.0",
5454
"ace-builds": "^1.32.0",
5555
"autoprefixer": "^10.4.16",
5656
"eslint": "^8.54.0",

app/src/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"2.0.0-beta.6","build_id":78,"total_build":282}
1+
{"version":"2.0.0-beta.6","build_id":92,"total_build":296}

app/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"2.0.0-beta.6","build_id":78,"total_build":282}
1+
{"version":"2.0.0-beta.6","build_id":92,"total_build":296}

app/vite.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@ import svgLoader from 'vite-svg-loader'
1010
import AutoImport from 'unplugin-auto-import/vite'
1111
import DefineOptions from 'unplugin-vue-define-options/vite'
1212

13+
function fixAntdvWarningPlugin() {
14+
return {
15+
name: 'fix-antd-vue-warning', //
16+
transform(code: string, id: string) {
17+
// replace antdv js only
18+
if (id.includes('ant-design-vue/es/_util/hooks/_vueuse')) {
19+
// replace /* #__PURE__ */ with empty string
20+
const newCode = code.replace(/\/\* #__PURE__ \*\//g, '')
21+
22+
return {
23+
code: newCode,
24+
map: null,
25+
}
26+
}
27+
},
28+
}
29+
}
30+
1331
// https://vitejs.dev/config/
1432
export default defineConfig(({ mode }) => {
1533
// eslint-disable-next-line n/prefer-global/process
@@ -33,6 +51,8 @@ export default defineConfig(({ mode }) => {
3351
],
3452
},
3553
plugins: [
54+
fixAntdvWarningPlugin(),
55+
3656
vue(),
3757
vueJsx(),
3858

0 commit comments

Comments
 (0)