diff --git a/packages/vant-cli/package.json b/packages/vant-cli/package.json index 7084cdb9c..ec39c3143 100644 --- a/packages/vant-cli/package.json +++ b/packages/vant-cli/package.json @@ -60,7 +60,6 @@ "@vue/babel-plugin-jsx": "^1.1.1", "autoprefixer": "^10.4.0", "chalk": "^4.1.2", - "clean-css": "^5.2.2", "commander": "^8.3.0", "consola": "^2.15.3", "conventional-changelog": "^3.1.24", diff --git a/packages/vant-cli/src/compiler/compile-css.ts b/packages/vant-cli/src/compiler/compile-css.ts index 7070490da..0e2b8f359 100644 --- a/packages/vant-cli/src/compiler/compile-css.ts +++ b/packages/vant-cli/src/compiler/compile-css.ts @@ -1,15 +1,17 @@ import postcss from 'postcss'; import postcssrc from 'postcss-load-config'; -import CleanCss from 'clean-css'; +import { transform } from 'esbuild'; import { POSTCSS_CONFIG_FILE } from '../common/constant.js'; -const cleanCss = new CleanCss(); - export async function compileCss(source: string | Buffer) { const config = await postcssrc({}, POSTCSS_CONFIG_FILE); const { css } = await postcss(config.plugins as any).process(source, { from: undefined, }); - - return cleanCss.minify(css).styles; + const result = await transform(css, { + loader: 'css', + minify: true, + target: ['chrome53', 'safari10'], + }); + return result.code; } diff --git a/packages/vant-cli/src/module.d.ts b/packages/vant-cli/src/module.d.ts index 6cb75ccd6..d2726548a 100644 --- a/packages/vant-cli/src/module.d.ts +++ b/packages/vant-cli/src/module.d.ts @@ -1,7 +1,6 @@ // some modules with missing type definitions declare module 'execa'; declare module 'hash-sum'; -declare module 'clean-css'; declare module 'release-it'; declare module 'conventional-changelog'; declare module '@vant/markdown-vetur'; diff --git a/packages/vant/src/address-list/index.less b/packages/vant/src/address-list/index.less index 0e2331a2b..25f14c01e 100644 --- a/packages/vant/src/address-list/index.less +++ b/packages/vant/src/address-list/index.less @@ -94,7 +94,7 @@ right: var(--van-padding-md); color: var(--van-gray-6); font-size: var(--van-address-list-edit-icon-size); - transform: translate(0, -50%); + transform: translateY(-50%); } .van-cell { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0be1ee71c..9b6bd54db 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -104,7 +104,6 @@ importers: '@vue/babel-plugin-jsx': ^1.1.1 autoprefixer: ^10.4.0 chalk: ^4.1.2 - clean-css: ^5.2.2 commander: ^8.3.0 consola: ^2.15.3 conventional-changelog: ^3.1.24 @@ -153,7 +152,6 @@ importers: '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.16.0 autoprefixer: 10.4.0_postcss@8.3.11 chalk: 4.1.2 - clean-css: 5.2.2 commander: 8.3.0 consola: 2.15.3 conventional-changelog: 3.1.24 @@ -2477,13 +2475,6 @@ packages: source-map: 0.6.1 dev: false - /clean-css/5.2.2: - resolution: {integrity: sha1-06fG7iURAR4FFxmDi9z4MU3EVI0=, tarball: clean-css/download/clean-css-5.2.2.tgz} - engines: {node: '>= 10.0'} - dependencies: - source-map: 0.6.1 - dev: false - /clean-stack/2.2.0: resolution: {integrity: sha1-7oRy27Ep5yezHooQpCfe6d/kAIs=, tarball: clean-stack/download/clean-stack-2.2.0.tgz} engines: {node: '>=6'}