Skip to content

Commit c5f40c2

Browse files
authored
fix: avoid inlineDynamicImports ignored with codeSplitting warning when using Vite 8 (#15647)
Closes #15646. Fixed by not defining inlineDynamicImports when building service worker with Vite 8. --- ### Please don't delete this checklist! Before submitting the PR, please make sure you do the following: - [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] This message body should clearly illustrate what problems it solves. - [ ] Ideally, include a test that fails without this PR but passes with it. ### Tests - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check` ### Changesets - [x] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`. ### Edits - [x] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.
1 parent ce32533 commit c5f40c2

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/small-lines-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: avoid inlineDynamicImports ignored with codeSplitting warning when using Vite 8

packages/kit/src/exports/vite/build/build_service_worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export async function build_service_worker(
110110
// .mjs so that esbuild doesn't incorrectly inject `export` https://github.com/vitejs/vite/issues/15379
111111
entryFileNames: `service-worker.${is_rolldown ? 'js' : 'mjs'}`,
112112
assetFileNames: `${kit.appDir}/immutable/assets/[name].[hash][extname]`,
113-
inlineDynamicImports: !is_rolldown
113+
inlineDynamicImports: !is_rolldown ? true : undefined
114114
}
115115
},
116116
outDir: `${out}/client`,

0 commit comments

Comments
 (0)