@modular-css/vite 29.1.2 → 29.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 29.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#919](https://github.com/tivac/modular-css/pull/919) [`989d1f0`](https://github.com/tivac/modular-css/commit/989d1f06caf0505d7cc7bfee52f29afd5a0a7760) Thanks [@tivac](https://github.com/tivac)! - Vite 4 support
8
+
3
9
  ## 29.1.2
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modular-css/vite",
3
- "version": "29.1.2",
3
+ "version": "29.1.3",
4
4
  "description": "vite support for modular-css",
5
5
  "main": "./vite.js",
6
6
  "repository": {
@@ -28,9 +28,9 @@
28
28
  "dependencies": {
29
29
  "@modular-css/css-to-js": "^28.4.1",
30
30
  "@modular-css/processor": "^28.1.5",
31
- "@rollup/pluginutils": "^4.1.2"
31
+ "@rollup/pluginutils": "^5.0.2"
32
32
  },
33
33
  "peerDependencies": {
34
- "vite": "^3.0.3"
34
+ "vite": "^3 || ^4"
35
35
  }
36
36
  }
@@ -0,0 +1,5 @@
1
+ .a {
2
+ composes: c from "./c.mcss";
3
+
4
+ color: red;
5
+ }
@@ -0,0 +1,5 @@
1
+ .b {
2
+ composes: c from "./c.mcss";
3
+
4
+ color: white;
5
+ }
@@ -0,0 +1,6 @@
1
+ .c {
2
+ background-color: blue;
3
+
4
+ width: 100px;
5
+ height: 100px;
6
+ }
@@ -0,0 +1,9 @@
1
+ <!DOCTYPE html>
2
+
3
+ <body>
4
+ <div id="a">A</div>
5
+
6
+ <div id="b">B</div>
7
+
8
+ <script type="module" src="./script.js"></script>
9
+ </body>
@@ -0,0 +1,10 @@
1
+ import a from "./a.mcss";
2
+ import b from "./b.mcss";
3
+
4
+ console.log({ a, b });
5
+
6
+ const aEl = document.querySelector("#a");
7
+ const bEl = document.querySelector("#b");
8
+
9
+ aEl.className = a.a;
10
+ bEl.className = b.b;
@@ -0,0 +1,25 @@
1
+ import { test, expect } from "@playwright/test";
2
+
3
+ test.beforeEach(async ({ page }) => {
4
+ await page.goto("/");
5
+ })
6
+
7
+ test("a is right", async ({ page }) => {
8
+ const el = await page.getByText("A");
9
+
10
+ await expect(el).toBeVisible();
11
+
12
+ await expect(el).toHaveCSS("background-color", "rgb(0, 0, 255)");
13
+ await expect(el).toHaveCSS("color", "rgb(255, 0, 0)");
14
+ await expect(el).toHaveClass("mc_c mc_a");
15
+ });
16
+
17
+ test("b is right", async ({ page }) => {
18
+ const el = await page.getByText("B");
19
+
20
+ await expect(el).toBeVisible();
21
+
22
+ await expect(el).toHaveCSS("background-color", "rgb(0, 0, 255)");
23
+ await expect(el).toHaveCSS("color", "rgb(255, 255, 255)");
24
+ await expect(el).toHaveClass("mc_c mc_b");
25
+ });