Skip to content

Commit 7bb5229

Browse files
authored
fix: invalidate module in createQwikPlugin slows down cypress component tests (#7726)
* fix: invalidate module in createQwikPlugin slows down cypress component tests * chore: add !devServer check
1 parent 07c59ee commit 7bb5229

File tree

1 file changed

+7
-15
lines changed
  • packages/qwik/src/optimizer/src/plugins

1 file changed

+7
-15
lines changed

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

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -745,21 +745,13 @@ export function createQwikPlugin(optimizerOptions: OptimizerOptions = {}) {
745745
parentIds.set(key, id);
746746
currentOutputs.set(key, [mod, id]);
747747
deps.add(key);
748-
if (opts.target === 'client') {
749-
if (devServer) {
750-
// invalidate the segment so that the client will pick it up
751-
const rollupModule = devServer.moduleGraph.getModuleById(key);
752-
if (rollupModule) {
753-
devServer.moduleGraph.invalidateModule(rollupModule);
754-
}
755-
} else {
756-
// rollup must be told about all entry points
757-
ctx.emitFile({
758-
id: key,
759-
type: 'chunk',
760-
preserveSignature: 'allow-extension',
761-
});
762-
}
748+
if (opts.target === 'client' && !devServer) {
749+
// rollup must be told about all entry points
750+
ctx.emitFile({
751+
id: key,
752+
type: 'chunk',
753+
preserveSignature: 'allow-extension',
754+
});
763755
}
764756
}
765757
}

0 commit comments

Comments
 (0)