From 99f5eff400958d225ab296fe2816f9e836ce0512 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Mon, 23 May 2022 14:37:56 -0700 Subject: [PATCH] fix(ct): do not break if there are no components (2) --- packages/playwright-test/src/plugins/vitePlugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/playwright-test/src/plugins/vitePlugin.ts b/packages/playwright-test/src/plugins/vitePlugin.ts index f9c43a6138..884419b612 100644 --- a/packages/playwright-test/src/plugins/vitePlugin.ts +++ b/packages/playwright-test/src/plugins/vitePlugin.ts @@ -77,7 +77,7 @@ export function createPlugin( // 2. Check if the set of required components has changed. const hasNewComponents = await checkNewComponents(buildInfo, componentRegistry); // 3. Check component sources. - const sourcesDirty = hasNewComponents || await checkSources(buildInfo); + const sourcesDirty = !buildExists || hasNewComponents || await checkSources(buildInfo); viteConfig.root = rootDir; viteConfig.preview = { port }; @@ -85,7 +85,7 @@ export function createPlugin( outDir }; const { build, preview } = require('vite'); - if (!buildExists || sourcesDirty) { + if (sourcesDirty) { viteConfig.plugins = viteConfig.plugins || [ frameworkPluginFactory() ];