Просмотр исходного кода

fix(compat): add `entities` to @vue/compat deps to fix CJS edge cases (#12514)

Fixes #10609

Unlike the `vue` package, direct dependencies of `@vue/compat` are not
externalized:
https://github.com/vuejs/core/blob/201936f9a3909ae9dca4e131e1f5ad5a1c0feb77/rollup.config.js#L274

So it depends on `entities` directly in its CJS build, unlike the `vue`
one which indirectly depends on it via `@vue/compiler-core`.
So `entities` must be explicitly added to `@vue/compat` deps to avoid
incorrect dependency resolution due to different `node_modules` layouts,
such as in https://github.com/vuejs/core/issues/10609#issuecomment-2160369155
Haoqun Jiang 1 месяц назад
Родитель
Сommit
e725a679e4
4 измененных файлов с 10 добавлено и 2 удалено
  1. 1 1
      packages/compiler-core/package.json
  2. 1 0
      packages/vue-compat/package.json
  3. 7 1
      pnpm-lock.yaml
  4. 1 0
      pnpm-workspace.yaml

+ 1 - 1
packages/compiler-core/package.json

@@ -48,7 +48,7 @@
   "dependencies": {
     "@babel/parser": "catalog:",
     "@vue/shared": "workspace:*",
-    "entities": "^7.0.1",
+    "entities": "catalog:",
     "estree-walker": "catalog:",
     "source-map-js": "catalog:"
   },

+ 1 - 0
packages/vue-compat/package.json

@@ -53,6 +53,7 @@
   "homepage": "https://github.com/vuejs/core/tree/main/packages/vue-compat#readme",
   "dependencies": {
     "@babel/parser": "catalog:",
+    "entities": "catalog:",
     "estree-walker": "catalog:",
     "source-map-js": "catalog:"
   },

+ 7 - 1
pnpm-lock.yaml

@@ -15,6 +15,9 @@ catalogs:
     '@vitejs/plugin-vue':
       specifier: ^6.0.4
       version: 6.0.4
+    entities:
+      specifier: ^7.0.1
+      version: 7.0.1
     estree-walker:
       specifier: ^2.0.2
       version: 2.0.2
@@ -253,7 +256,7 @@ importers:
         specifier: workspace:*
         version: link:../shared
       entities:
-        specifier: ^7.0.1
+        specifier: 'catalog:'
         version: 7.0.1
       estree-walker:
         specifier: 'catalog:'
@@ -428,6 +431,9 @@ importers:
       '@babel/parser':
         specifier: 'catalog:'
         version: 7.29.0
+      entities:
+        specifier: 'catalog:'
+        version: 7.0.1
       estree-walker:
         specifier: 'catalog:'
         version: 2.0.2

+ 1 - 0
pnpm-workspace.yaml

@@ -5,6 +5,7 @@ packages:
 catalog:
   '@babel/parser': ^7.29.0
   '@babel/types': ^7.29.0
+  'entities': '^7.0.1'
   'estree-walker': ^2.0.2
   'magic-string': ^0.30.21
   'source-map-js': ^1.2.1