fix: applying fixes needed for legacy builder plugin
authorShane Jaroch <chown_tee@proton.me>
Sat, 10 Jan 2026 21:29:10 +0000 (16:29 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sat, 10 Jan 2026 21:29:10 +0000 (16:29 -0500)
README.md
package.json
vite.config.js

index 75842c404de06ba9e95297bedf19a6ae540e44fe..beb186bd45c12d50ed6c55fcdd066e4e99ee436b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,38 +1,47 @@
-# sv
+# SvelteKit Legacy Template
 
-Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
+This project is a SvelteKit template configured for legacy browser support (IE11) using `@vitejs/plugin-legacy`.
 
-## Creating a project
+## Setup
 
-If you're seeing this, you've probably already done this step. Congrats!
-
-```sh
-# create a new project in the current directory
-npx sv create
-
-# create a new project in my-app
-npx sv create my-app
-```
+1.  Install dependencies:
+    ```bash
+    npm install
+    # or
+    pnpm install
+    ```
 
 ## Developing
 
-Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
+Start the development server:
 
-```sh
+```bash
 npm run dev
-
-# or start the server and open the app in a new browser tab
-npm run dev -- --open
 ```
 
-## Building
+*Note: The development server uses Vite's modern ESM serving and does NOT emulate legacy browsers. To test legacy support, you must build and preview.*
+
+## Building (Legacy Support)
 
-To create a production version of your app:
+To generate the production build, which includes both modern chunks and legacy chunks (transpiled for IE11):
 
-```sh
+```bash
 npm run build
 ```
 
-You can preview the production build with `npm run preview`.
+This command will:
+1.  Build the server-side code.
+2.  Build the client-side code (Modern).
+3.  Generate potential legacy chunks and polyfills via `@vitejs/plugin-legacy`.
+
+You will see output indicating `legacy` chunks are being generated.
+
+## Serving / Previewing
+
+To serve the built application (production mode) and verify legacy loading:
+
+```bash
+npm run preview
+```
 
-> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
+Open the exposed URL (e.g., `http://localhost:4173`) in your legacy browser (e.g., IE11 virtual machine) to verify it loads correctly.
index dfe4e2c77a20bf636cb432dd63db736831805fe1..20f858f1bdda0cf4f225a5ddb53214b9cae9d3dc 100644 (file)
@@ -1,8 +1,9 @@
 {
-       "name": "website-template-svkit-v2-legacy",
-       "private": true,
+       "name": "@tg-svelte/website-template-svkit-v2-legacy",
        "version": "0.0.1",
        "type": "module",
+       "description": "SvelteKit v2 website sample/template with IE11 legacy support configuration.",
+       "private": true,
        "author": "Shane Jaroch <chown_tee@proton.me>",
        "contributors": [
                "Tal Hadad <tal_hd@hotmail.com>"
                "dev": "vite dev",
                "build": "vite build",
                "preview": "vite preview",
-               "prepare": "svelte-kit sync || echo ''",
                "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
                "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch"
        },
        "devDependencies": {
-               "@sveltejs/adapter-auto": "^7.0.0",
-               "@sveltejs/kit": "^2.49.1",
-               "@sveltejs/vite-plugin-svelte": "^6.2.1",
-               "svelte": "^5.45.6",
-               "svelte-check": "^4.3.4",
-               "typescript": "^5.9.3",
-               "vite": "^7.2.6"
+               "@sveltejs/adapter-auto": "^3.0.0",
+               "@sveltejs/kit": "npm:@tg-svelte/kit@^2.49.4",
+               "@sveltejs/vite-plugin-svelte": "^3.0.0",
+               "@vitejs/plugin-legacy": "^5.0.0",
+               "svelte": "^5.0.0-next.1",
+               "svelte-check": "^3.6.0",
+               "terser": "^5.0.0",
+               "vite": "^5.0.0"
+       },
+       "overrides": {
+               "@sveltejs/kit": "file:../../packages/kit"
+       },
+       "pnpm": {
+               "overrides": {
+                       "@sveltejs/kit": "file:../../packages/kit"
+               }
        }
 }
index bbf8c7da43f0080dc6b9fb275f9583b7c17f1506..0bab3e1bd1f71091e3d6c01289c92eece5b1a0d1 100644 (file)
@@ -1,6 +1,12 @@
 import { sveltekit } from '@sveltejs/kit/vite';
 import { defineConfig } from 'vite';
+import legacy from '@vitejs/plugin-legacy';
 
 export default defineConfig({
-       plugins: [sveltekit()]
+       plugins: [
+               legacy({
+                       targets: ['ie 11']
+               }),
+               sveltekit()
+       ]
 });