feat(editor): Add vue-scan for frontend performance tracking (no-changelog) (#16995)

This commit is contained in:
Alex Grozav
2025-07-04 13:01:01 +03:00
committed by GitHub
parent 34aae9665d
commit fe8a7221d6
7 changed files with 79 additions and 3 deletions

View File

@@ -99,7 +99,8 @@
"vue3-touch-events": "^4.1.3",
"vuedraggable": "4.1.0",
"web-tree-sitter": "0.24.3",
"xss": "catalog:"
"xss": "catalog:",
"z-vue-scan": "^0.0.35"
},
"devDependencies": {
"@faker-js/faker": "^8.0.2",

View File

@@ -25,6 +25,8 @@ import { createPinia, PiniaVuePlugin } from 'pinia';
import { ChartJSPlugin } from '@/plugins/chartjs';
import { SentryPlugin } from '@/plugins/sentry';
import type { VueScanOptions } from 'z-vue-scan';
const pinia = createPinia();
const app = createApp(App);
@@ -40,6 +42,13 @@ app.use(router);
app.use(i18nInstance);
app.use(ChartJSPlugin);
if (import.meta.env.VUE_SCAN) {
const { default: VueScan } = await import('z-vue-scan');
app.use<VueScanOptions>(VueScan, {
enable: true,
});
}
app.mount('#app');
if (!import.meta.env.PROD) {

View File

@@ -14,6 +14,7 @@ declare global {
PROD: boolean;
NODE_ENV: 'development' | 'production';
VUE_APP_URL_BASE_API: string;
VUE_SCAN: boolean;
};
}

View File

@@ -131,7 +131,7 @@ export default mergeConfig(
plugins,
resolve: { alias },
base: publicPath,
envPrefix: 'VUE_APP',
envPrefix: 'VUE',
css: {
preprocessorOptions: {
scss: {