Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/real-cups-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/vite-plugin-svelte': patch
---

log known-issues link when using rolldown-vite
38 changes: 25 additions & 13 deletions packages/e2e-tests/kit-node/__tests__/kit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ import {

import glob from 'tiny-glob';
import path from 'node:path';
import { defaultClientConditions, defaultClientMainFields } from 'vite';
import { env } from 'node:process';
import * as vite from 'vite';
const {
defaultClientConditions,
defaultClientMainFields,
//@ts-expect-error not typed in vite
rolldownVersion
} = vite;
import { describe, expect, it } from 'vitest';

describe('kit-node', () => {
Expand Down Expand Up @@ -93,18 +100,23 @@ describe('kit-node', () => {
});

if (isBuild) {
it('should not include dynamic import from onmount in ssr output', async () => {
const ssrManifest = JSON.parse(
readFileContent('.svelte-kit/output/server/.vite/manifest.json')
);
const serverFilesSrc = Object.values(ssrManifest)
.filter((e) => !!e.src)
.map((e) => e.src);
const includesClientOnlyModule = serverFilesSrc.some((file: string) =>
file.includes('client-only-module')
);
expect(includesClientOnlyModule).toBe(false);
});
// this is known to fail, skip the test in our own CI but keep it in ecosystem-ci so that rolldown-vite-ecosystem-ci still gets this fail
// TODO remove skip once fixed
it.skipIf(rolldownVersion && !env.ECOSYSTEM_CI)(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is known to fail with rolldown-vite, to avoid local ci from being red all the time we skip it, but keep it active in ecosystem-ci so once the fix is in, we'll know and can remove this

'should not include dynamic import from onMount in ssr output',
async () => {
const ssrManifest = JSON.parse(
readFileContent('.svelte-kit/output/server/.vite/manifest.json')
);
const serverFilesSrc = Object.values(ssrManifest)
.filter((e) => !!e.src)
.map((e) => e.src);
const includesClientOnlyModule = serverFilesSrc.some((file: string) =>
file.includes('client-only-module')
);
expect(includesClientOnlyModule).toBe(false);
}
);
it('should include dynamic import from onmount in client output', async () => {
const clientManifest = JSON.parse(
readFileContent('.svelte-kit/output/client/.vite/manifest.json')
Expand Down
6 changes: 5 additions & 1 deletion packages/e2e-tests/scan-deps/__tests__/scan-deps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ describe('vite import scan', () => {
it('should not fail to discover dependencies exported from script module', async () => {
// vite logs an error if scan fails but continues, so validate no errors logged
const errorLogs = e2eServer.logs.server.err.filter(
(line) => !line.includes('Support for rolldown-vite in vite-plugin-svelte is experimental')
(line) =>
![
'Support for rolldown-vite in vite-plugin-svelte is experimental',
'See https://github.com/sveltejs/vite-plugin-svelte/issues/1143 for a list of known issues'
].some((ignore) => line.includes(ignore))
);
expect(errorLogs.length, `unexpected errors:\n${errorLogs.join('\n')}`).toBe(0);
});
Expand Down
6 changes: 5 additions & 1 deletion packages/vite-plugin-svelte/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export function svelte(inlineOptions) {
}
if (rolldownVersion) {
log.warn.once(
`!!! Support for rolldown-vite in vite-plugin-svelte is experimental (rolldown: ${rolldownVersion}, vite: ${viteVersion}) !!!`
`!!! Support for rolldown-vite in vite-plugin-svelte is experimental (rolldown: ${rolldownVersion}, vite: ${viteVersion}) !!!
See https://github.com/sveltejs/vite-plugin-svelte/issues/1143 for a list of known issues and to report feedback.`.replace(
/\t+/g,
'\t'
)
);
}

Expand Down