Skip to content

Comments

Migrate from Webpack to Vite#1126

Merged
CryZe merged 1 commit intoLiveSplit:masterfrom
CryZe:vite-but-this-time-for-real
Feb 23, 2026
Merged

Migrate from Webpack to Vite#1126
CryZe merged 1 commit intoLiveSplit:masterfrom
CryZe:vite-but-this-time-for-real

Conversation

@CryZe
Copy link
Collaborator

@CryZe CryZe commented Feb 23, 2026

Replaces Webpack with Vite 7 as the build tool.

Build system

  • Replace webpack.config.js with vite.config.ts
  • Update all npm scripts (serve, publish, tauri:build-html) to use Vite
  • Remove Webpack-related dependencies (webpack, css-loader, style-loader, ts-loader, html-webpack-plugin, workbox-webpack-plugin, etc.)
  • Add Vite dependencies (vite, @vitejs/plugin-react, vite-plugin-pwa, favicons)
  • Add tsconfig.node.json for the Vite config file

WASM & asset preloading

  • Custom Vite plugin injects <link rel="preload"> tags and an inline <script> with WebAssembly.compileStreaming for the WASM file, matching Webpack's inline script behavior
  • Preloads both font files (timer, FiraSans) for the preload scanner

PWA

  • Service worker registration is now inlined via vite-plugin-pwa (injectRegister: "inline")
  • Service worker filename kept as service-worker.js for migration compatibility
  • Favicon generation moved from favicons-webpack-plugin to the favicons library, run at config time
  • Added support for PWA install screenshots (screenshot-wide.png, screenshot-narrow.png)
  • Generated icons written to icons (gitignored)

Code changes

  • Remove indexDelayed.ts — imports moved directly into index.tsx since Vite handles code splitting automatically
  • CSS module imports changed from import * as classes to import classes (Vite default export style)
  • Several import statements changed to import type for type-only imports
  • Add "ESNext" to tsconfig lib, add "vite/client" types
  • Nest .segmentIconContainer styles inside .runEditorTable in RunEditor.module.css (this was necessary because the order of the
    CSS changed).
  • Safari compatibility: Babel plugin for using declarations
  • Dev builds tolerate GitHub API failures gracefully

Dependency updates

  • lucide-react ^0.544.0 → ^0.575.0
  • eslint ^9.20.1 → ^10.0.1

@CryZe CryZe force-pushed the vite-but-this-time-for-real branch from ab03f58 to 8711711 Compare February 23, 2026 19:12
Replaces Webpack with Vite 7 as the build tool.

**Build system**
- Replace `webpack.config.js` with vite.config.ts
- Update all npm scripts (`serve`, `publish`, `tauri:build-html`) to use Vite
- Remove Webpack-related dependencies (webpack, css-loader, style-loader, ts-loader, html-webpack-plugin, workbox-webpack-plugin, etc.)
- Add Vite dependencies (vite, @vitejs/plugin-react, vite-plugin-pwa, favicons)
- Add tsconfig.node.json for the Vite config file

**WASM & asset preloading**
- Custom Vite plugin injects `<link rel="preload">` tags and an inline `<script>` with `WebAssembly.compileStreaming` for the WASM file, matching Webpack's inline script behavior
- Preloads both font files (timer, FiraSans) for the preload scanner

**PWA**
- Service worker registration is now inlined via vite-plugin-pwa (`injectRegister: "inline"`)
- Service worker filename kept as `service-worker.js` for migration compatibility
- Favicon generation moved from `favicons-webpack-plugin` to the `favicons` library, run at config time
- Added support for PWA install screenshots (`screenshot-wide.png`, `screenshot-narrow.png`)
- Generated icons written to icons (gitignored)

**Code changes**
- Remove `indexDelayed.ts` — imports moved directly into `index.tsx` since Vite handles code splitting automatically
- CSS module imports changed from `import * as classes` to `import classes` (Vite default export style)
- Several `import` statements changed to `import type` for type-only imports
- Add `"ESNext"` to tsconfig lib, add `"vite/client"` types
- Nest `.segmentIconContainer` styles inside `.runEditorTable` in
  `RunEditor.module.css` (this was necessary because the order of the
  CSS changed).
- Safari compatibility: Babel plugin for `using` declarations
- Dev builds tolerate GitHub API failures gracefully

**Dependency updates**
- lucide-react ^0.544.0 → ^0.575.0
- eslint ^9.20.1 → ^10.0.1
@CryZe CryZe force-pushed the vite-but-this-time-for-real branch from 8711711 to 47306cb Compare February 23, 2026 19:41
@CryZe CryZe enabled auto-merge (squash) February 23, 2026 19:53
@CryZe CryZe merged commit 1d978ab into LiveSplit:master Feb 23, 2026
4 checks passed
@CryZe CryZe deleted the vite-but-this-time-for-real branch February 23, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant