fix(kit): support @vitejs/plugin-legacy multi-output and configure fork metadata main 1/head
authorShane Jaroch <chown_tee@proton.me>
Sat, 10 Jan 2026 21:23:15 +0000 (16:23 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sat, 10 Jan 2026 22:42:43 +0000 (17:42 -0500)
Original work by Tal500.

packages/kit/package.json
packages/kit/src/exports/vite/index.js
pnpm-lock.yaml

index 54fcca8f7a51741c31b0dd1d07a8ab1fec2dcfd6..f5dd9a2e3f9f9884da0a3d36f5176f2c1bbe4498 100644 (file)
@@ -1,7 +1,7 @@
 {
-       "name": "@sveltejs/kit",
+       "name": "@tg-svelte/kit",
        "version": "2.49.4",
-       "description": "SvelteKit is the fastest way to build Svelte apps",
+       "description": "SvelteKit fork with legacy browser support (IE11) and static builds",
        "keywords": [
                "framework",
                "official",
@@ -9,6 +9,8 @@
                "sveltekit",
                "vite"
        ],
+       "author": "Shane Jaroch <chown_tee@proton.me>",
+       "contributors": ["Tal Hadad <tal_hd@hotmail.com>"],
        "repository": {
                "type": "git",
                "url": "git+https://github.com/sveltejs/kit.git",
index 75205067d4ea74b879d494c0c2616291cf64754e..af494557d241cf5ce5b9d28730b8a22e65c593ed 100644 (file)
@@ -1096,27 +1096,26 @@ async function kit({ svelte_config }) {
                                        const getLastFlat = (/** @type {unknown} */ arrOrObj) =>
                                                Array.isArray(arrOrObj) ? arrOrObj[arrOrObj.length - 1] : arrOrObj;
 
+                                       const buildResult = await vite.build({
+                                               configFile: vite_config.configFile,
+                                               // CLI args
+                                               mode: vite_config_env.mode,
+                                               logLevel: vite_config.logLevel,
+                                               clearScreen: vite_config.clearScreen,
+                                               build: {
+                                                       minify: initial_config.build?.minify,
+                                                       assetsInlineLimit: vite_config.build.assetsInlineLimit,
+                                                       sourcemap: vite_config.build.sourcemap
+                                               },
+                                               optimizeDeps: {
+                                                       force: vite_config.optimizeDeps.force
+                                               }
+                                       });
                                        const bundle = /** @type {import('vite').Rollup.RollupOutput} */ (
-                                               getLastFlat(
-                                                       await vite.build({
-                                                               configFile: vite_config.configFile,
-                                                               // CLI args
-                                                               mode: vite_config_env.mode,
-                                                               logLevel: vite_config.logLevel,
-                                                               clearScreen: vite_config.clearScreen,
-                                                               build: {
-                                                                       minify: initial_config.build?.minify,
-                                                                       assetsInlineLimit: vite_config.build.assetsInlineLimit,
-                                                                       sourcemap: vite_config.build.sourcemap
-                                                               },
-                                                               optimizeDeps: {
-                                                                       force: vite_config.optimizeDeps.force
-                                                               }
-                                                       })
-                                               )
+                                               getLastFlat(buildResult)
                                        );
 
-                                       client_chunks = bundle.output;
+                                       client_chunks = bundle.output || Object.values(bundle);
                                } catch (e) {
                                        const error =
                                                e instanceof Error ? e : new Error(/** @type {any} */ (e).message ?? e ?? '<unknown>');
@@ -1192,7 +1191,7 @@ async function kit({ svelte_config }) {
                                        )
                                });
 
-                               const start_deps = find_deps_with_optional_legacy(`${runtime_directory}/client`, 'start');
+                               const start_deps = find_deps_with_optional_legacy(`${runtime_directory}/client`, 'entry');
                                const app_deps = find_deps_with_optional_legacy(`${kit.outDir}/generated/client-optimized`, 'app');
 
                                build_data.client = {
@@ -1217,7 +1216,7 @@ async function kit({ svelte_config }) {
 
                                if (svelte_config.kit.output.bundleStrategy === 'split') {
                                        // Legacy PR: Use the legacy-aware objects we created above, but ensure imports/stylesheets/fonts are merged
-                                       const start_legacy = find_deps_with_optional_legacy(`${runtime_directory}/client`, 'start');
+                                       const start_legacy = find_deps_with_optional_legacy(`${runtime_directory}/client`, 'entry');
                                        const app_legacy = find_deps_with_optional_legacy(`${kit.outDir}/generated/client-optimized`, 'app');
 
                                        build_data.client = {
index 1a691b9f9463993444bcd3f41a9d27f6a8fde473..1236b8babffdb1b512e4a1878b82d9c0e41cec9f 100644 (file)
@@ -1597,10 +1597,6 @@ packages:
     resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==}
     engines: {node: '>=6.9.0'}
 
-  '@babel/helper-validator-identifier@7.27.1':
-    resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==}
-    engines: {node: '>=6.9.0'}
-
   '@babel/helper-validator-identifier@7.28.5':
     resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==}
     engines: {node: '>=6.9.0'}
@@ -1617,11 +1613,6 @@ packages:
     resolution: {integrity: sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==}
     engines: {node: '>=6.9.0'}
 
-  '@babel/parser@7.27.5':
-    resolution: {integrity: sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==}
-    engines: {node: '>=6.0.0'}
-    hasBin: true
-
   '@babel/parser@7.28.5':
     resolution: {integrity: sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==}
     engines: {node: '>=6.0.0'}
@@ -2971,10 +2962,6 @@ packages:
   '@jridgewell/gen-mapping@0.3.13':
     resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
 
-  '@jridgewell/gen-mapping@0.3.5':
-    resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==}
-    engines: {node: '>=6.0.0'}
-
   '@jridgewell/remapping@2.3.5':
     resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==}
 
@@ -2982,10 +2969,6 @@ packages:
     resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
     engines: {node: '>=6.0.0'}
 
-  '@jridgewell/set-array@1.2.1':
-    resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==}
-    engines: {node: '>=6.0.0'}
-
   '@jridgewell/source-map@0.3.6':
     resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==}
 
@@ -8262,7 +8245,7 @@ snapshots:
 
   '@babel/code-frame@7.27.1':
     dependencies:
-      '@babel/helper-validator-identifier': 7.27.1
+      '@babel/helper-validator-identifier': 7.28.5
       js-tokens: 4.0.0
       picocolors: 1.1.1
 
@@ -8298,7 +8281,7 @@ snapshots:
 
   '@babel/helper-annotate-as-pure@7.27.3':
     dependencies:
-      '@babel/types': 7.28.1
+      '@babel/types': 7.28.5
 
   '@babel/helper-compilation-targets@7.27.2':
     dependencies:
@@ -8359,14 +8342,14 @@ snapshots:
     dependencies:
       '@babel/core': 7.28.5
       '@babel/helper-module-imports': 7.27.1
-      '@babel/helper-validator-identifier': 7.27.1
+      '@babel/helper-validator-identifier': 7.28.5
       '@babel/traverse': 7.28.5
     transitivePeerDependencies:
       - supports-color
 
   '@babel/helper-optimise-call-expression@7.27.1':
     dependencies:
-      '@babel/types': 7.28.1
+      '@babel/types': 7.28.5
 
   '@babel/helper-plugin-utils@7.27.1': {}
 
@@ -8391,14 +8374,12 @@ snapshots:
   '@babel/helper-skip-transparent-expression-wrappers@7.27.1':
     dependencies:
       '@babel/traverse': 7.28.5
-      '@babel/types': 7.28.1
+      '@babel/types': 7.28.5
     transitivePeerDependencies:
       - supports-color
 
   '@babel/helper-string-parser@7.27.1': {}
 
-  '@babel/helper-validator-identifier@7.27.1': {}
-
   '@babel/helper-validator-identifier@7.28.5': {}
 
   '@babel/helper-validator-option@7.27.1': {}
@@ -8416,10 +8397,6 @@ snapshots:
       '@babel/template': 7.27.2
       '@babel/types': 7.28.5
 
-  '@babel/parser@7.27.5':
-    dependencies:
-      '@babel/types': 7.28.1
-
   '@babel/parser@7.28.5':
     dependencies:
       '@babel/types': 7.28.5
@@ -8892,7 +8869,7 @@ snapshots:
     dependencies:
       '@babel/core': 7.28.5
       '@babel/helper-plugin-utils': 7.27.1
-      '@babel/types': 7.28.1
+      '@babel/types': 7.28.5
       esutils: 2.0.3
 
   '@babel/runtime@7.26.10':
@@ -8920,7 +8897,7 @@ snapshots:
   '@babel/types@7.28.1':
     dependencies:
       '@babel/helper-string-parser': 7.27.1
-      '@babel/helper-validator-identifier': 7.27.1
+      '@babel/helper-validator-identifier': 7.28.5
 
   '@babel/types@7.28.5':
     dependencies:
@@ -9693,25 +9670,17 @@ snapshots:
       '@jridgewell/sourcemap-codec': 1.5.5
       '@jridgewell/trace-mapping': 0.3.31
 
-  '@jridgewell/gen-mapping@0.3.5':
-    dependencies:
-      '@jridgewell/set-array': 1.2.1
-      '@jridgewell/sourcemap-codec': 1.5.5
-      '@jridgewell/trace-mapping': 0.3.25
-
   '@jridgewell/remapping@2.3.5':
     dependencies:
-      '@jridgewell/gen-mapping': 0.3.5
-      '@jridgewell/trace-mapping': 0.3.25
+      '@jridgewell/gen-mapping': 0.3.13
+      '@jridgewell/trace-mapping': 0.3.31
 
   '@jridgewell/resolve-uri@3.1.2': {}
 
-  '@jridgewell/set-array@1.2.1': {}
-
   '@jridgewell/source-map@0.3.6':
     dependencies:
-      '@jridgewell/gen-mapping': 0.3.5
-      '@jridgewell/trace-mapping': 0.3.25
+      '@jridgewell/gen-mapping': 0.3.13
+      '@jridgewell/trace-mapping': 0.3.31
 
   '@jridgewell/sourcemap-codec@1.5.5': {}
 
@@ -10068,7 +10037,7 @@ snapshots:
 
   '@netlify/zip-it-and-ship-it@14.1.7(rollup@4.50.1)(supports-color@10.0.0)':
     dependencies:
-      '@babel/parser': 7.27.5
+      '@babel/parser': 7.28.5
       '@babel/types': 7.28.1
       '@netlify/binary-info': 1.0.0
       '@netlify/serverless-functions-api': 2.5.0
@@ -11041,7 +11010,7 @@ snapshots:
 
   '@vue/compiler-core@3.5.16':
     dependencies:
-      '@babel/parser': 7.27.5
+      '@babel/parser': 7.28.5
       '@vue/shared': 3.5.16
       entities: 4.5.0
       estree-walker: 2.0.2
@@ -11054,7 +11023,7 @@ snapshots:
 
   '@vue/compiler-sfc@3.5.16':
     dependencies:
-      '@babel/parser': 7.27.5
+      '@babel/parser': 7.28.5
       '@vue/compiler-core': 3.5.16
       '@vue/compiler-dom': 3.5.16
       '@vue/compiler-ssr': 3.5.16
@@ -13646,7 +13615,7 @@ snapshots:
 
   node-source-walk@7.0.1:
     dependencies:
-      '@babel/parser': 7.27.5
+      '@babel/parser': 7.28.5
 
   node-stream-zip@1.15.0: {}
 
@@ -14294,7 +14263,7 @@ snapshots:
 
   resolve@2.0.0-next.5:
     dependencies:
-      is-core-module: 2.13.1
+      is-core-module: 2.16.1
       path-parse: 1.0.7
       supports-preserve-symlinks-flag: 1.0.0
 
@@ -14774,7 +14743,7 @@ snapshots:
 
   svelte-check@4.3.4(picomatch@4.0.3)(svelte@5.42.2)(typescript@5.8.3):
     dependencies:
-      '@jridgewell/trace-mapping': 0.3.25
+      '@jridgewell/trace-mapping': 0.3.31
       chokidar: 4.0.3
       fdir: 6.5.0(picomatch@4.0.3)
       picocolors: 1.1.1