zksu
/
WEB
forked from yoone/WEB
1
0
Fork 0

build: 添加 code-inspector-plugin 依赖及配置

添加 code-inspector-plugin 作为开发依赖,并在 webpack 配置中启用该插件以增强代码检查能力
This commit is contained in:
tikkhun 2025-10-14 11:08:54 +08:00
parent 7c5e4917dd
commit 37c8518289
2 changed files with 9 additions and 0 deletions

View File

@ -4,6 +4,7 @@ const isDev = process.env.NODE_ENV === 'development';
const UMI_APP_API_URL = isDev const UMI_APP_API_URL = isDev
? 'http://localhost:7001' ? 'http://localhost:7001'
: 'https://api.yoone.ca'; : 'https://api.yoone.ca';
import { codeInspectorPlugin } from 'code-inspector-plugin';
export default defineConfig({ export default defineConfig({
hash: true, hash: true,
@ -18,6 +19,13 @@ export default defineConfig({
define: { define: {
UMI_APP_API_URL, UMI_APP_API_URL,
}, },
chainWebpack(config) {
config.plugin('code-inspector-plugin').use(
codeInspectorPlugin({
bundler: 'webpack',
})
);
},
routes: [ routes: [
{ path: '/', redirect: '/home' }, { path: '/', redirect: '/home' },
{ name: '追踪', path: '/track', component: './Track', layout: false }, { name: '追踪', path: '/track', component: './Track', layout: false },

View File

@ -32,6 +32,7 @@
"devDependencies": { "devDependencies": {
"@types/react": "^18.0.33", "@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11", "@types/react-dom": "^18.0.11",
"code-inspector-plugin": "^1.2.10",
"husky": "^9", "husky": "^9",
"lint-staged": "^13.2.0", "lint-staged": "^13.2.0",
"prettier": "^2.8.7", "prettier": "^2.8.7",