Add prototype using lightningcss for minification

fixup
This commit is contained in:
Jordan Pittman 2022-09-15 14:01:12 -04:00
parent 9735d8d82a
commit 215e86f0f3
4 changed files with 91 additions and 27 deletions

View file

@ -96,6 +96,24 @@ describe('Build command', () => {
expect(withoutMinify.length).toBeGreaterThan(withMinify.length)
})
test('--minify applies Lightning CSS optimizations', async () => {
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
await writeInputFile(
'index.css',
css`
.text-teal {
color: hsl(calc(360deg / 2) 50% 50%);
}
`
)
await $(`${EXECUTABLE} --input ./src/index.css --output ./dist/main.css --minify`)
let withMinify = await readOutputFile('main.css')
expect(withMinify).toEqual(`.text-teal{color:#40bfbf}`)
})
test('--no-autoprefixer', async () => {
await writeInputFile('index.html', html`<div class="select-none"></div>`)