From 37c8518289caea10a583321d2f30e0bf7424688e Mon Sep 17 00:00:00 2001 From: tikkhun Date: Tue, 14 Oct 2025 11:08:54 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E6=B7=BB=E5=8A=A0=20code-inspector-pl?= =?UTF-8?q?ugin=20=E4=BE=9D=E8=B5=96=E5=8F=8A=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 code-inspector-plugin 作为开发依赖,并在 webpack 配置中启用该插件以增强代码检查能力 --- .umirc.ts | 8 ++++++++ package.json | 1 + 2 files changed, 9 insertions(+) diff --git a/.umirc.ts b/.umirc.ts index 8abb35a..723972c 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -4,6 +4,7 @@ const isDev = process.env.NODE_ENV === 'development'; const UMI_APP_API_URL = isDev ? 'http://localhost:7001' : 'https://api.yoone.ca'; + import { codeInspectorPlugin } from 'code-inspector-plugin'; export default defineConfig({ hash: true, @@ -18,6 +19,13 @@ export default defineConfig({ define: { UMI_APP_API_URL, }, + chainWebpack(config) { + config.plugin('code-inspector-plugin').use( + codeInspectorPlugin({ + bundler: 'webpack', + }) + ); + }, routes: [ { path: '/', redirect: '/home' }, { name: '追踪', path: '/track', component: './Track', layout: false }, diff --git a/package.json b/package.json index b09cc56..07c5682 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "devDependencies": { "@types/react": "^18.0.33", "@types/react-dom": "^18.0.11", + "code-inspector-plugin": "^1.2.10", "husky": "^9", "lint-staged": "^13.2.0", "prettier": "^2.8.7",