Deprecate --no-autoprefixer flag in the CLI (#11280)

* enable `--no-autoprefixer` test

* handle `--no-autoprefixer` using lightningcss

* bump default chrome version for lightningcss plugin

* handle `map` being nullable

* add `--no-autoprefixer` test including nesting

* set Chrome to version 111 as a default value

* resolve the output message when resolving the promise

* deprecate `--no-autoprefixer` for the CLI

* update changelog
This commit is contained in:
Robin Malfait 2023-05-25 16:06:00 +02:00 • committed by GitHub
parent 88ab01c7f8
commit 04c4de1997
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 41 additions and 24 deletions

View file

@ -96,27 +96,35 @@ describe('Build command', () => {
expect(withoutMinify.length).toBeGreaterThan(withMinify.length)
})
// TODO: Handle --no-autoprefixer
test.skip('--no-autoprefixer', async () => {
// Deprecated
test('--no-autoprefixer (should produce a warning)', async () => {
await writeInputFile('index.html', html`<div class="select-none"></div>`)
await writeInputFile(
'index.css',
css`
@tailwind utilities;
`
)
await $(`${EXECUTABLE} --output ./dist/main.css`)
let withAutoprefixer = await readOutputFile('main.css')
let runningProcess = $(
`${EXECUTABLE} --input ./src/index.css --output ./dist/main.css --no-autoprefixer`
)
let warning = runningProcess.onStderr((message) => message.includes('--no-autoprefixer'))
await runningProcess
expect(await warning).toMatchInlineSnapshot(`
"[deprecation] The --no-autoprefixer flag is deprecated and has no effect.
"
`)
let withoutAutoprefixer = await readOutputFile('main.css')
expect(withAutoprefixer).toIncludeCss(css`
.select-none {
// This contains --webkit-user-select which may be strange, but it is expected because we are
// not handling the `--no-autoprefixer` flag anymore at all.
expect(withoutAutoprefixer).toMatchInlineSnapshot(`
".select-none {
-webkit-user-select: none;
user-select: none;
}
`)
await $(`${EXECUTABLE} --output ./dist/main.css --no-autoprefixer`)
let withoutAutoprefixer = await readOutputFile('main.css')
expect(withoutAutoprefixer).toIncludeCss(css`
.select-none {
user-select: none;
}
"
`)
})
@ -492,7 +500,6 @@ describe('Build command', () => {
--postcss Load custom PostCSS configuration
-m, --minify Minify the output
-c, --config Path to a custom config file
--no-autoprefixer Disable autoprefixer
-h, --help Display usage information
`)
)