Skip to content

Commit ea23e81

Browse files
authored
fix: run every plugins only in development environment (#85)
1 parent c906ced commit ea23e81

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

.changeset/odd-bees-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik.dev/devtools': patch
3+
---
4+
5+
fix: run everyplugins only in development environment
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type Plugin } from 'vite';
22
import VueInspector from 'vite-plugin-inspect';
33
import { devtoolsPlugin } from './devtools';
4-
import qwikComponentProxy from './statistics';
4+
import { statisticsPlugin } from './statistics';
55

66
// Re-export individual plugins
77
export { devtoolsPlugin } from './devtools';
@@ -12,8 +12,8 @@ export { devtoolsPlugin } from './devtools';
1212
export function qwikDevtools(): Plugin[] {
1313
return [
1414
devtoolsPlugin(),
15-
VueInspector(),
16-
...qwikComponentProxy(),
15+
{ ...VueInspector(), apply: 'serve' },
16+
statisticsPlugin(),
1717
// Add more plugins here as needed
1818
];
1919
}

packages/plugin/src/plugin/statistics.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export function statisticsPlugin(): Plugin {
261261
return {
262262
name: 'vite:qwik-component-proxy-transform',
263263
enforce: 'post',
264-
264+
apply: 'serve',
265265
transform(code, id) {
266266
// Avoid rewriting imports inside the perf virtual module itself (otherwise `originalComponentQrl`
267267
// could become self-referential/undefined)
@@ -295,9 +295,4 @@ export function statisticsPlugin(): Plugin {
295295
attachSsrPerfInjectorMiddleware(server);
296296
},
297297
};
298-
}
299-
300-
// Backwards compatible default export (existing callers spread a Plugin[])
301-
export default function qwikComponentProxy(): Plugin[] {
302-
return [statisticsPlugin()];
303-
}
298+
}

0 commit comments

Comments
 (0)