Skip to content

Commit

Permalink
refactor: 使用code-inspector-plugin替换vite-plugin-vue-inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Nov 4, 2024
1 parent fd9ad7e commit 66f5d6d
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 58 deletions.
14 changes: 11 additions & 3 deletions build/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import svgLoader from "vite-svg-loader";
import type { PluginOption } from "vite";
import checker from "vite-plugin-checker";
import vueJsx from "@vitejs/plugin-vue-jsx";
import Inspector from "vite-plugin-vue-inspector";
import { configCompressPlugin } from "./compress";
import removeNoMatch from "vite-plugin-router-warn";
import { visualizer } from "rollup-plugin-visualizer";
import removeConsole from "vite-plugin-remove-console";
import { themePreprocessorPlugin } from "@pureadmin/theme";
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
import { codeInspectorPlugin } from "code-inspector-plugin";
import { genScssMultipleScopeVars } from "../src/layout/theme";
import { vitePluginFakeServer } from "vite-plugin-fake-server";

Expand All @@ -38,8 +38,16 @@ export function getPluginsList(
terminal: false,
enableBuild: false
}),
// 按下Command(⌘)+Shift(⇧),然后点击页面元素会自动打开本地IDE并跳转到对应的代码位置
Inspector(),
/**
* 在页面上按住组合键时,鼠标在页面移动即会在 DOM 上出现遮罩层并显示相关信息,点击一下将自动打开 IDE 并将光标定位到元素对应的代码位置
* Mac 默认组合键 Option + Shift
* Windows 默认组合键 Alt + Shift
* 更多用法看 https://inspector.fe-dev.cn/guide/start.html
*/
codeInspectorPlugin({
bundler: "vite",
hideConsole: true
}),
viteBuildInfo(),
/**
* 开发环境下移除非必要的vue-router动态路由警告No match found for location with path
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"@vitejs/plugin-vue-jsx": "^4.0.1",
"autoprefixer": "^10.4.20",
"boxen": "^8.0.1",
"code-inspector-plugin": "^0.17.7",
"cssnano": "^7.0.6",
"dagre": "^0.8.5",
"eslint": "^9.12.0",
Expand Down Expand Up @@ -166,7 +167,6 @@
"vite-plugin-fake-server": "^2.1.2",
"vite-plugin-remove-console": "^2.2.0",
"vite-plugin-router-warn": "^1.0.0",
"vite-plugin-vue-inspector": "^5.2.0",
"vite-svg-loader": "^5.1.0",
"vue-eslint-parser": "^9.4.3",
"vue-tsc": "^2.1.6"
Expand Down
Loading

0 comments on commit 66f5d6d

Please sign in to comment.