Repository navigation
build: drop vitePreprocess from the shared Svelte config - #2228
Conversation
svelte-check and the Vitest Svelte plugin load svelte.config.mjs, and its vitePreprocess() import pulls in Vite on every svelte-check run. The production build never reads this file and compiles every component without a preprocessor, so no component depends on one. Without it, svelte-check and Vitest compile components the way the bundle does.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable risk from the config change was found. The PR is mergeable after normal checks. Pre-merge checks |
|
|
Ship verification: PASS+NOTES Independent verification of this PR in fresh detached worktrees (head and parent), each with
Checks
Notes
|
Summary
svelte.config.mjsimportedvitePreprocess, which loads Vite on every svelte-check run. The production build never reads this file and compiles every component without a preprocessor, so no component can depend on one. Without it, svelte-check and the Vitest Svelte plugin compile components the way the bundle does, which is what the file's comment asks for.Measured on one GitHub runner, 8 rotating rounds per side (bench run 38288422505,
masteragainst this branch):pnpm run checkpnpm run build-with-lintOn top of #2227's native check, the same change measured 4.02 → 3.65 s for
checkand 6.40 → 6.01 s forbuild-with-lint, with 10 rounds per side (bench run 38285760933). The saving is the same size on both, because both load the config the same way.Changes
vitePreprocessimport and thepreprocessentry fromsvelte.config.mjs.Testing / validation
pnpm install --frozen-lockfile,pnpm run build-with-lint, andpnpm run testpass. The suite ran 501 files: 7,019 tests passed and 28 were skipped.main.jsandstyles.cssare byte-identical to master. Their hashes are d83aa6eeaa77bbcfe0e3574f3ab1e67c57469506074c43f5e67087bf64ae6127 and 9467ef3622cd1137ce5a0148e16de23b9f5be87bc8c204fb6050c48f8f29994d.<style lang>in the tree islang="css", which Svelte handles without a preprocessor.Independent of #2227. Either can merge first.
Release impact: none. The bundle is unchanged, and
build:requests no release.Checklist
Note
Remove
vitePreprocessfrom shared Svelte configRemoves the
vitePreprocessimport and thepreprocessproperty from svelte.config.mjs. Runes stay enabled throughcompilerOptions. Risk: tooling that loads this shared config no longer getsvitePreprocess(), so builds relying on it for CSS or TypeScript preprocessing may need their own setup.Macroscope summarized 4645ed5.
Summary by CodeRabbit