Skip to content

Commit 0c3d024

Browse files
committed
fix(vite): move opts initialization inside plugin function
The opts initialization was moved inside the async plugin function to ensure proper handling of options during dev mode. This fixes an issue where @qwik-handlers weren't properly handled in dev mode for library projects, as referenced in issue #7600.
1 parent 4377da0 commit 0c3d024

File tree

1 file changed

+3
-1
lines changed
  • packages/qwik/src/optimizer/src/plugins

1 file changed

+3
-1
lines changed

packages/qwik/src/optimizer/src/plugins/vite.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,8 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
649649
}
650650

651651
if (!qwikViteOpts.csr) {
652-
const opts = qwikPlugin.getOptions();
653652
const plugin = async () => {
653+
const opts = qwikPlugin.getOptions();
654654
const sys = qwikPlugin.getSys();
655655
const path = qwikPlugin.getPath();
656656
await configureDevServer(
@@ -668,6 +668,8 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
668668
const isNEW =
669669
(globalThis as any).__qwikRouterNew === true ||
670670
(globalThis as any).__qwikCityNew === true ||
671+
// related to this issue https://github.com/QwikDev/qwik/issues/7600
672+
// FIX: the @qwik-handlers aren't properly handled in dev mode for library projects
671673
server.config.build.lib;
672674

673675
if (isNEW) {

0 commit comments

Comments
 (0)