Bump to latest cssnano v6 (#14105)

We bundle cssnano in our CLI and it's on an older version that does not
handle nested CSS correctly. This PR updates it to the latest version of
v6.x

Fixes #14092
This commit is contained in:
Jordan Pittman 2024-08-02 08:57:14 -04:00 • committed by GitHub
parent 28bd90eefb
commit 1f23c2e842
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 475 additions and 400 deletions

View file

@ -96,6 +96,45 @@ describe('Build command', () => {
expect(withoutMinify.length).toBeGreaterThan(withMinify.length)
})
test('--minify does not break nested CSS', async () => {
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
await writeInputFile(
'input.css',
css`
.parent {
& .child {
color: red;
}
& .child {
&:not([href]) {
color: green;
}
}
}
`
)
await $(`${EXECUTABLE} --input ./src/input.css --output ./dist/main.css --minify`)
let withMinify = await readOutputFile('main.css')
// Verify that we got the expected output. Note: `.toIncludeCss` formats
// `actual` & `expected`
expect(withMinify).toIncludeCss(
css`
.parent {
& .child {
color: red;
}
& .child {
&:not([href]) {
color: green;
}
}
}
`
)
})
test('--no-autoprefixer', async () => {
await writeInputFile('index.html', html`<div class="select-none"></div>`)