Skip to content

Commit 1183ad3

Browse files
ocavuesxzz
andauthored
fix(css): remove empty js chunks (#799)
Co-authored-by: Kevin Deng <sxzz@sxzz.moe>
1 parent 0aae946 commit 1183ad3

File tree

57 files changed

+107
-426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+107
-426
lines changed

src/features/css/pure-chunk.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export function removePureCssChunks(
1515

1616
for (const [fileName, chunk] of Object.entries(bundle)) {
1717
if (chunk.type !== 'chunk') continue
18-
if (chunk.isEntry) continue
1918
if (chunk.exports.length > 0) continue
2019

2120
const moduleIds = Object.keys(chunk.modules)

tests/__snapshots__/case-insensitivity/IMPORT-and-LAYER-are-case-insensitive.snap.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,3 @@
1818
}
1919

2020
```
21-
22-
## entry.mjs
23-
24-
```mjs
25-
export {};
26-
27-
```

tests/__snapshots__/charset/charset-in-imported-files.snap.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,3 @@
44
@charset "utf-8"; .box { background-color: red; } .box { background-color: green; }
55

66
```
7-
8-
## style.mjs
9-
10-
```mjs
11-
export {};
12-
13-
```

tests/__snapshots__/code-splitting/CSS-and-JS-code-splitting-with-shared-modules.snap.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ body {
3333

3434
```
3535

36-
## c.mjs
37-
38-
```mjs
39-
export {};
40-
41-
```
42-
4336
## d.css
4437

4538
```css
@@ -53,13 +46,6 @@ body {
5346

5447
```
5548

56-
## d.mjs
57-
58-
```mjs
59-
export {};
60-
61-
```
62-
6349
## shared-D_781BoD.mjs
6450

6551
```mjs

tests/__snapshots__/css-entry-point/css-file-as-sole-entry.snap.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,3 @@ body {
77
}
88

99
```
10-
11-
## entry.mjs
12-
13-
```mjs
14-
export {};
15-
16-
```

tests/__snapshots__/css-entry-point/multiple-CSS-entry-points.snap.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77

88
```
99

10-
## a.mjs
11-
12-
```mjs
13-
export {};
14-
15-
```
16-
1710
## b.css
1811

1912
```css
@@ -22,10 +15,3 @@ export {};
2215
}
2316

2417
```
25-
26-
## b.mjs
27-
28-
```mjs
29-
export {};
30-
31-
```

tests/__snapshots__/css/216.snap.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111

1212
```
1313

14-
## bar.mjs
15-
16-
```mjs
17-
export {};
18-
19-
```
20-
2114
## foo.css
2215

2316
```css
@@ -26,10 +19,3 @@ export {};
2619
}
2720

2821
```
29-
30-
## foo.mjs
31-
32-
```mjs
33-
export {};
34-
35-
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## style.css
2+
3+
```css
4+
.foo .bar {
5+
color: red;
6+
}
7+
8+
```

tests/__snapshots__/css/css-syntax-lowering.snap.md renamed to tests/__snapshots__/css/css-syntax-lowering-entry-index-ts-.snap.md

File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## style.css
2+
3+
```css
4+
.foo {
5+
& .bar {
6+
color: red;
7+
}
8+
}
9+
10+
```

0 commit comments

Comments
 (0)