Skip to content

Commit a352678

Browse files
committed
test: add test case
1 parent 461455a commit a352678

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { readFile } from 'node:fs/promises';
2+
import { join } from 'node:path';
3+
import { build, dev, rspackOnlyTest } from '@e2e/helper';
4+
import { expect } from '@playwright/test';
5+
6+
rspackOnlyTest(
7+
'should let lightningcss minimizer inherit from tools.lightningcssLoader',
8+
async ({ page }) => {
9+
const cssIndex = join(__dirname, 'dist/static/css/index.css');
10+
11+
await dev({
12+
cwd: __dirname,
13+
page,
14+
});
15+
const devContent = await readFile(cssIndex, 'utf-8');
16+
expect(devContent).toContain('margin-inline-end: 100px;');
17+
18+
await build({
19+
cwd: __dirname,
20+
});
21+
const buildContent = await readFile(cssIndex, 'utf-8');
22+
expect(buildContent).toContain('margin-inline-end:100px');
23+
},
24+
);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineConfig } from '@rsbuild/core';
2+
3+
export default defineConfig({
4+
dev: {
5+
writeToDisk: true,
6+
},
7+
output: {
8+
filenameHash: false,
9+
overrideBrowserslist: ['Chrome >= 53'],
10+
},
11+
tools: {
12+
lightningcssLoader: {
13+
exclude: {
14+
logicalProperties: true,
15+
},
16+
},
17+
},
18+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.foo {
2+
margin-inline-end: 100px;
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import './index.css';

0 commit comments

Comments
 (0)