Преглед на файлове

fix(compiler-sfc): don't registerTS when bundling for browsers (#8582)

三咲智子 Kevin Deng преди 2 години
родител
ревизия
6f45f76df2
променени са 4 файла, в които са добавени 15 реда и са изтрити 1 реда
  1. 1 0
      packages/vue/compiler-sfc/index.browser.js
  2. 1 0
      packages/vue/compiler-sfc/index.browser.mjs
  3. 10 0
      packages/vue/package.json
  4. 3 1
      pnpm-lock.yaml

+ 1 - 0
packages/vue/compiler-sfc/index.browser.js

@@ -0,0 +1 @@
+module.exports = require('@vue/compiler-sfc')

+ 1 - 0
packages/vue/compiler-sfc/index.browser.mjs

@@ -0,0 +1 @@
+export * from '@vue/compiler-sfc'

+ 10 - 0
packages/vue/package.json

@@ -44,10 +44,12 @@
     "./compiler-sfc": {
     "./compiler-sfc": {
       "import": {
       "import": {
         "types": "./compiler-sfc/index.d.mts",
         "types": "./compiler-sfc/index.d.mts",
+        "browser": "./compiler-sfc/index.browser.mjs",
         "default": "./compiler-sfc/index.mjs"
         "default": "./compiler-sfc/index.mjs"
       },
       },
       "require": {
       "require": {
         "types": "./compiler-sfc/index.d.ts",
         "types": "./compiler-sfc/index.d.ts",
+        "browser": "./compiler-sfc/index.browser.js",
         "default": "./compiler-sfc/index.js"
         "default": "./compiler-sfc/index.js"
       }
       }
     },
     },
@@ -99,5 +101,13 @@
     "@vue/runtime-dom": "3.3.4",
     "@vue/runtime-dom": "3.3.4",
     "@vue/compiler-sfc": "3.3.4",
     "@vue/compiler-sfc": "3.3.4",
     "@vue/server-renderer": "3.3.4"
     "@vue/server-renderer": "3.3.4"
+  },
+  "peerDependencies": {
+    "typescript": "*"
+  },
+  "peerDependenciesMeta": {
+    "typescript": {
+      "optional": true
+    }
   }
   }
 }
 }

+ 3 - 1
pnpm-lock.yaml

@@ -386,6 +386,9 @@ importers:
       '@vue/shared':
       '@vue/shared':
         specifier: 3.3.4
         specifier: 3.3.4
         version: link:../shared
         version: link:../shared
+      typescript:
+        specifier: '*'
+        version: 5.0.2
 
 
   packages/vue-compat:
   packages/vue-compat:
     dependencies:
     dependencies:
@@ -5410,7 +5413,6 @@ packages:
     resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==}
     resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==}
     engines: {node: '>=12.20'}
     engines: {node: '>=12.20'}
     hasBin: true
     hasBin: true
-    dev: true
 
 
   /ufo@1.1.1:
   /ufo@1.1.1:
     resolution: {integrity: sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==}
     resolution: {integrity: sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==}