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:
parent
28bd90eefb
commit
1f23c2e842
5 changed files with 475 additions and 400 deletions
|
|
@ -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>`)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue