From 034a361cd5486de3e2cba93f2c8c6fb6c3aca0da Mon Sep 17 00:00:00 2001 From: Jerry_Wu <409187100@qq.com> Date: Thu, 8 Jan 2026 16:58:05 +0800 Subject: [PATCH 1/2] BUG: everyplugins just run in development environment --- .changeset/odd-bees-knock.md | 5 +++++ packages/plugin/src/plugin/index.ts | 6 +++--- packages/plugin/src/plugin/statistics.ts | 9 ++------- 3 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 .changeset/odd-bees-knock.md diff --git a/.changeset/odd-bees-knock.md b/.changeset/odd-bees-knock.md new file mode 100644 index 0000000..26d4e49 --- /dev/null +++ b/.changeset/odd-bees-knock.md @@ -0,0 +1,5 @@ +--- +'@qwik.dev/devtools': patch +--- + +BUG: everyplugins just run in development environment diff --git a/packages/plugin/src/plugin/index.ts b/packages/plugin/src/plugin/index.ts index bc54e85..b322f8f 100644 --- a/packages/plugin/src/plugin/index.ts +++ b/packages/plugin/src/plugin/index.ts @@ -1,7 +1,7 @@ import { type Plugin } from 'vite'; import VueInspector from 'vite-plugin-inspect'; import { devtoolsPlugin } from './devtools'; -import qwikComponentProxy from './statistics'; +import { statisticsPlugin } from './statistics'; // Re-export individual plugins export { devtoolsPlugin } from './devtools'; @@ -12,8 +12,8 @@ export { devtoolsPlugin } from './devtools'; export function qwikDevtools(): Plugin[] { return [ devtoolsPlugin(), - VueInspector(), - ...qwikComponentProxy(), + { ...VueInspector(), apply: 'serve' }, + statisticsPlugin(), // Add more plugins here as needed ]; } diff --git a/packages/plugin/src/plugin/statistics.ts b/packages/plugin/src/plugin/statistics.ts index f75e6c3..cb758a4 100644 --- a/packages/plugin/src/plugin/statistics.ts +++ b/packages/plugin/src/plugin/statistics.ts @@ -261,7 +261,7 @@ export function statisticsPlugin(): Plugin { return { name: 'vite:qwik-component-proxy-transform', enforce: 'post', - + apply: 'serve', transform(code, id) { // Avoid rewriting imports inside the perf virtual module itself (otherwise `originalComponentQrl` // could become self-referential/undefined) @@ -295,9 +295,4 @@ export function statisticsPlugin(): Plugin { attachSsrPerfInjectorMiddleware(server); }, }; -} - -// Backwards compatible default export (existing callers spread a Plugin[]) -export default function qwikComponentProxy(): Plugin[] { - return [statisticsPlugin()]; -} +} \ No newline at end of file From 080270b4653e1b9955c6a5e78afff2e30175d0f3 Mon Sep 17 00:00:00 2001 From: Giorgio Boa <35845425+gioboa@users.noreply.github.com> Date: Thu, 8 Jan 2026 11:55:02 +0100 Subject: [PATCH 2/2] chore: update .changeset --- .changeset/odd-bees-knock.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/odd-bees-knock.md b/.changeset/odd-bees-knock.md index 26d4e49..f442289 100644 --- a/.changeset/odd-bees-knock.md +++ b/.changeset/odd-bees-knock.md @@ -2,4 +2,4 @@ '@qwik.dev/devtools': patch --- -BUG: everyplugins just run in development environment +fix: run everyplugins only in development environment