Skip to content

Commit e7a355e

Browse files
committed
chore: add html-minifier-terser for test snap
1 parent 66d3bd0 commit e7a355e

File tree

5 files changed

+44
-29
lines changed

5 files changed

+44
-29
lines changed

.changeset/young-shrimps-boil.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
---
44

55
feat: add custom unit patch support
6+
7+
chore: use `consola` and `fs-extra`

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@tailwindcss-mangle/shared": "workspace:*",
3434
"@tsconfig/recommended": "^1.0.7",
3535
"@types/fs-extra": "^11.0.4",
36+
"@types/html-minifier-terser": "^7.0.2",
3637
"@types/lodash-es": "^4.17.12",
3738
"@types/node": "^20.14.11",
3839
"@vitest/coverage-v8": "^2.0.3",
@@ -43,6 +44,7 @@
4344
"del": "^7.1.0",
4445
"eslint": "^9.7.0",
4546
"fs-extra": "^11.2.0",
47+
"html-minifier-terser": "^7.2.0",
4648
"local-pkg": "^0.5.0",
4749
"lodash-es": "^4.17.21",
4850
"only-allow": "^1.2.1",

packages/unplugin-tailwindcss-mangle/test/__snapshots__/vite.test.ts.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,15 +1175,15 @@ exports[`vite build > common build change class prefix 2`] = `
11751175
`;
11761176
11771177
exports[`vite build > common build change class prefix 3`] = `
1178-
"<!doctype html>
1178+
"<!DOCTYPE html>
11791179
<html lang="en">
11801180
<head>
1181-
<meta charset="UTF-8" />
1182-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
1183-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1181+
<meta charset="UTF-8">
1182+
<link rel="icon" type="image/svg+xml" href="/vite.svg">
1183+
<meta name="viewport" content="width=device-width,initial-scale=1">
11841184
<title>Vite + TS</title>
11851185
<script type="module" crossorigin src="/index.js"></script>
1186-
<link rel="stylesheet" crossorigin href="/index.css" />
1186+
<link rel="stylesheet" crossorigin href="/index.css">
11871187
</head>
11881188
<body>
11891189
<div id="app"></div>

packages/unplugin-tailwindcss-mangle/test/vite.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'node:path'
22
import { build } from 'vite'
33
import type { RollupOutput } from 'rollup'
4-
import prettier from 'prettier'
4+
import { minify } from 'html-minifier-terser'
55
import utwm from '@/vite'
66

77
const appRoot = path.resolve(__dirname, 'fixtures/vite-repo')
@@ -77,8 +77,7 @@ describe('vite build', () => {
7777
}
7878
expect(output[2].type).toBe('asset')
7979
if (output[2].type === 'asset') {
80-
const res = await prettier.format(output[2].source.toString(), {
81-
parser: 'html',
80+
const res = await minify(output[2].source.toString(), {
8281
})
8382
expect(res).toMatchSnapshot()
8483
}

pnpm-lock.yaml

Lines changed: 33 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)