From 4aeff318bda747aec4e0c5b98a1e73a2e2031987 Mon Sep 17 00:00:00 2001 From: edison Date: Fri, 15 Nov 2024 10:37:55 +0800 Subject: [PATCH] chore(deps): update dependency postcss-selector-parser to v7 (#12289) --- packages/compiler-sfc/package.json | 2 +- packages/compiler-sfc/src/style/pluginScoped.ts | 3 +-- pnpm-lock.yaml | 13 +++++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index bd9224e65be..df16e4663e1 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -60,7 +60,7 @@ "merge-source-map": "^1.1.0", "minimatch": "~9.0.5", "postcss-modules": "^6.0.0", - "postcss-selector-parser": "^6.1.2", + "postcss-selector-parser": "^7.0.0", "pug": "^3.0.3", "sass": "^1.80.6" } diff --git a/packages/compiler-sfc/src/style/pluginScoped.ts b/packages/compiler-sfc/src/style/pluginScoped.ts index b0224cf20d8..d0aaddd7676 100644 --- a/packages/compiler-sfc/src/style/pluginScoped.ts +++ b/packages/compiler-sfc/src/style/pluginScoped.ts @@ -189,8 +189,7 @@ function rewriteSelector( // global: replace with inner selector and do not inject [id]. // ::v-global(.foo) -> .foo if (value === ':global' || value === '::v-global') { - selectorRoot.insertAfter(selector, n.nodes[0]) - selectorRoot.removeChild(selector) + selector.replaceWith(n.nodes[0]) return false } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74a863972bd..83a347d885b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -327,8 +327,8 @@ importers: specifier: ^6.0.0 version: 6.0.0(postcss@8.4.48) postcss-selector-parser: - specifier: ^6.1.2 - version: 6.1.2 + specifier: ^7.0.0 + version: 7.0.0 pug: specifier: ^3.0.3 version: 3.0.3 @@ -2845,6 +2845,10 @@ packages: resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} engines: {node: '>=4'} + postcss-selector-parser@7.0.0: + resolution: {integrity: sha512-9RbEr1Y7FFfptd/1eEdntyjMwLeghW1bHX9GWjXo19vx4ytPQhANltvVxDggzJl7mnWM+dX28kb6cyS/4iQjlQ==} + engines: {node: '>=4'} + postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} @@ -5861,6 +5865,11 @@ snapshots: cssesc: 3.0.0 util-deprecate: 1.0.2 + postcss-selector-parser@7.0.0: + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + postcss-value-parser@4.2.0: {} postcss@8.4.41: