Skip to content

Commit de9a173

Browse files
authored
More playwright (#928)
* test: test built vite sites as well * test: validate dynamic import ordering Looks like my hack in https://github.com/tivac/modular-css/blob/4af74248fb2bda844dd8c0a2ef3831e2edd94f26/packages/vite/vite.js#L196-L203 totally does fix the issue described in vitejs/vite#3924 which is exciting and somewhat surprising? * test: simplify via playwright projects * trying again
1 parent 4ba4e33 commit de9a173

File tree

17 files changed

+132
-45
lines changed

17 files changed

+132
-45
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"release": "changeset publish",
1717
"test": "jest",
1818
"test:playwright": "playwright test",
19-
"start:vite": "vite",
2019
"watch": "jest --watch",
2120
"start": "npm start --workspace=@modular-css/www",
2221
"www:build": "npm run build --workspace=@modular-css/www",

packages/vite/tests/specimens/a.mcss

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/vite/tests/specimens/b.mcss

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.a {
2+
composes: c from "../shared/dynamic-c.mcss";
3+
4+
color: red;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.b {
2+
composes: c from "../shared/dynamic-c.mcss";
3+
4+
color: white;
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const aEl = document.querySelector("#a");
2+
const bEl = document.querySelector("#b");
3+
4+
(async function() {
5+
const a = await import("./a.mcss");
6+
const b = await import("./b.mcss");
7+
8+
console.log({ a, b });
9+
10+
aEl.className = a.a;
11+
bEl.className = b.b;
12+
}());
13+
Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
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>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.c {
2+
background-color: blue;
3+
4+
width: 100px;
5+
height: 100px;
6+
}

0 commit comments

Comments
 (0)