build: migrate from webpack to vite#1105
Merged
Merged
Conversation
…-paths to v6 - vitest: ^2.1.9 -> ^4.1.5 - @vitest/coverage-v8: ^2.1.9 -> ^4.1.5 - vite-tsconfig-paths: ^5.1.4 -> ^6.1.1 Migrate vitest configs for v4 breaking changes: - Replace removed UserConfigExport type with ViteUserConfigExport - Replace removed defineWorkspace with plain array export - Use defineProject instead of defineConfig for workspace projects
The default hookTimeout is 10s but constructRoutes in beforeAll can take longer, especially when spawning torrent client daemons.
Add TorrentStore cleanup to the `cleanupStory` function in `Overview.stories.tsx` to prevent stale data from leaking between stories.
marcinmajsc
pushed a commit
to marcinmajsc/flood
that referenced
this pull request
May 2, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate the frontend build toolchain from webpack to Vite, and Storybook from
@storybook/react-webpack5to@storybook/react-vite. Use@lingui/vite-pluginfor i18n catalog compilation instead of@lingui/loader.Key Changes
Vite Configuration
vite.config.tswith@vitejs/plugin-react,@lingui/vite-plugin, path aliases (@client,@shared), SCSS/PostCSS, dev server proxy (/api→http://127.0.0.1:3000), and production build output todist/assets/client/src/vite-env.d.tsfor Vite client type declarationsclient/src/index.htmlwith<script type="module" src="/javascript/app.tsx">— Vite usesindex.htmlas the entry point instead of a webpackentryconfigBuild Script
scripts/build.mjsto use Vite'sbuild()API instead ofwebpack(). The esbuild server-bundle-with-embedded-assets step is unchanged.Lingui Integration
?linguiquery parameter (e.g.import {messages} from './strings/en.json?lingui') instead of the webpack loader syntax@lingui/loader!./strings/en.json?raw-linguideclare module '*?lingui'intypings.d.tsso TypeScript understands the import shape without@ts-expect-errorlanguages.tsxand.storybook/preview.tsxStorybook Migration
@storybook/react-webpack5to@storybook/react-vitewebpackFinalwithviteFinalin.storybook/main.ts: mock aliases viaresolve.alias(replacesNormalModuleReplacementPlugin),@lingui/vite-pluginfor catalog compilation, SCSS config@storybook/addon-webpack5-compiler-babeladdon@storybook/react-webpack5→@storybook/react-viteAsset & Import Changes
CountryFlag.tsx: replaced webpack dynamicimport()with Vite'simport.meta.globfor flag imagesAboutTab.tsx: raw markdown import uses?rawsuffix instead of webpackraw-loaderloadOverlayScrollbars.ts: replaced!raw-loader!inline syntax with?rawsuffixapp.tsx: removedwebpackPrefetch/webpackPreloadmagic commentsSCSS
~prefix from@import 'ress'instyle.scss— Vite resolves bare specifiers fromnode_modulesnativelyimportdeprecation in Vite config (ressis a third-party CSS file that can't be converted to@use)Runtime Fix
FloodActions.ts: replacedglobal.document,global.setTimeout,global.clearTimeoutwith direct browser APIs — webpack polyfillsglobalaswindow, Vite doesn'tDeleted Files
client/config/webpack.config.dev.mjsclient/config/webpack.config.prod.mjsclient/scripts/development.mjsclient/scripts/development.jsclient/scripts/utils/(entire directory)client/config/(entire directory)Dependencies
Added:
vite,@vitejs/plugin-react,@lingui/vite-plugin,@storybook/react-viteRemoved:
webpack,webpack-dev-server,webpackbar,html-webpack-plugin,mini-css-extract-plugin,css-minimizer-webpack-plugin,terser-webpack-plugin,babel-loader,css-loader,postcss-loader,sass-loader,style-loader,source-map-loader,file-loader,raw-loader,case-sensitive-paths-webpack-plugin,eslint-webpack-plugin,@pmmmwh/react-refresh-webpack-plugin,react-refresh,@storybook/builder-webpack5,@storybook/react-webpack5,@storybook/addon-webpack5-compiler-babel,@lingui/loaderKept:
@babel/core,@babel/eslint-parser,@babel/preset-env,@babel/preset-react,@babel/preset-typescript(still used by ESLint'sbabelParserfor.js/.jsxfiles and by@lingui/cliextraction)Verification
pnpm run check-typespassespnpm run lintpasses (0 warnings)pnpm run buildproducesdist/assets/(client) anddist/index.js(server with embedded assets)