diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java index 58eed56fb6b..aea7822da46 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeUpdater.java @@ -438,6 +438,7 @@ Map getDefaultDevDependencies() { defaults.put("vite", "v3.0.2"); defaults.put("@rollup/plugin-replace", "3.1.0"); defaults.put("rollup-plugin-brotli", "3.1.0"); + defaults.put("rollup-plugin-postcss-lit", "2.0.0"); defaults.put("vite-plugin-checker", "0.4.9"); defaults.put("mkdirp", "1.0.4"); // for application-theme-plugin defaults.put("workbox-build", WORKBOX_VERSION); diff --git a/flow-server/src/main/resources/vite.generated.ts b/flow-server/src/main/resources/vite.generated.ts index dfae1436b71..2728194dd6b 100644 --- a/flow-server/src/main/resources/vite.generated.ts +++ b/flow-server/src/main/resources/vite.generated.ts @@ -18,6 +18,7 @@ import * as rollup from 'rollup'; import brotli from 'rollup-plugin-brotli'; import replace from '@rollup/plugin-replace'; import checker from 'vite-plugin-checker'; +import postcssLit from 'rollup-plugin-postcss-lit'; const appShellUrl = '.'; @@ -485,6 +486,16 @@ export const vaadinConfig: UserConfigFn = (env) => { settings.offlineEnabled && injectManifestToSWPlugin(), !devMode && statsExtracterPlugin(), themePlugin({devMode}), + postcssLit({ + include: ['**/*.css', '**/*.css\?*'], + exclude: [ + `${themeFolder}/**/*.css`, + `${themeFolder}/**/*.css\?*`, + `${themeResourceFolder}/**/*.css`, + `${themeResourceFolder}/**/*.css\?*`, + '**/*\?html-proxy*' + ] + }), { name: 'vaadin:force-remove-spa-middleware', transformIndexHtml: { diff --git a/flow-tests/test-custom-frontend-directory/test-themes-custom-frontend-directory/src/test/java/com/vaadin/flow/uitest/ui/theme/ThemeIT.java b/flow-tests/test-custom-frontend-directory/test-themes-custom-frontend-directory/src/test/java/com/vaadin/flow/uitest/ui/theme/ThemeIT.java index 4ceeedc7727..88c5b4ff596 100644 --- a/flow-tests/test-custom-frontend-directory/test-themes-custom-frontend-directory/src/test/java/com/vaadin/flow/uitest/ui/theme/ThemeIT.java +++ b/flow-tests/test-custom-frontend-directory/test-themes-custom-frontend-directory/src/test/java/com/vaadin/flow/uitest/ui/theme/ThemeIT.java @@ -22,7 +22,6 @@ import java.util.stream.Collectors; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; @@ -45,7 +44,6 @@ public class ThemeIT extends ChromeBrowserTest { - @Ignore("Vite issue with web components styles https://github.com/vaadin/flow/issues/14142") @Test public void typeScriptCssImport_stylesAreApplied() { getDriver().get(getRootURL() + "/path/hello"); diff --git a/flow-tests/test-themes/src/test/java/com/vaadin/flow/uitest/ui/theme/ThemeIT.java b/flow-tests/test-themes/src/test/java/com/vaadin/flow/uitest/ui/theme/ThemeIT.java index f9f8405b694..e749bc00e5b 100644 --- a/flow-tests/test-themes/src/test/java/com/vaadin/flow/uitest/ui/theme/ThemeIT.java +++ b/flow-tests/test-themes/src/test/java/com/vaadin/flow/uitest/ui/theme/ThemeIT.java @@ -26,7 +26,6 @@ import java.util.stream.Collectors; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; @@ -48,7 +47,6 @@ public class ThemeIT extends ChromeBrowserTest { - @Ignore("Vite issue with web components styles https://github.com/vaadin/flow/issues/14142") @Test public void typeScriptCssImport_stylesAreApplied() { getDriver().get(getRootURL() + "/path/hello");