From 67d0b6bce44adf41c64c058c0b99807833e6b963 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 10:11:18 +0000 Subject: [PATCH] feat(roll): roll to ToT Playwright (19-02-25) --- nodejs/docs/test-components.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nodejs/docs/test-components.mdx b/nodejs/docs/test-components.mdx index 510e138916d..7e5823d177f 100644 --- a/nodejs/docs/test-components.mdx +++ b/nodejs/docs/test-components.mdx @@ -800,6 +800,14 @@ export default defineConfig({ }); ``` +### How do I use CSS imports? + +If you have a component that imports CSS, Vite will handle it automatically. You can also use CSS pre-processors such as Sass, Less, or Stylus, and Vite will handle them as well without any additional configuration. However, corresponding CSS pre-processor needs to be installed. + +Vite has a hard requirement that all CSS Modules are named `*.module.[css extension]`. If you have a custom build config for your project normally and have imports of the form `import styles from 'styles.css'` you must rename your files to properly indicate they are to be treated as modules. You could also write a Vite plugin to handle this for you. + +Check [Vite documentation](https://vite.dev/guide/features#css) for more details. + ### How can I test components that uses Pinia? Pinia needs to be initialized in `playwright/index.{js,ts,jsx,tsx}`. If you do this inside a `beforeMount` hook, the `initialState` can be overwritten on a per-test basis: