-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update compiler, tests and examples to use Svelte 5 #233
Conversation
@@ -202,7 +201,7 @@ export default function sveltePlugin(options?: esbuildSvelteOptions): Plugin { | |||
dependencyModifcationTimes.set(args.path, statSync(args.path).mtime); // add the target file | |||
|
|||
let compilerOptions = { | |||
css: (svelteVersion < 3 ? false : "external") as boolean | "external", | |||
css: (svelteVersion < 3 ? undefined : "external") as CompileOptions["css"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking at this a bit more, I'm fairly sure this logic is broken for everything between Svelte 3.43.0 and 3.53.0 (when support for "external" was added). And actually, false
is never returned at all since the version lock requires Svelte >3.43.0
. Fun.
Probably not a huge deal, but all the more reason to tear it out soon!
Whoops! Could you reopen or create a new PR pointing at |
Hi @EMH333 @Greenheart , what's the status on this? |
@zazer1 please see #234, and note the current version of esbuild-svelte is compatible with Svelte 5, minus support for |
This is based on findings in #230 (review).
Updating the main devDependencies in
package.json
to Svelte 5 and re-building the plugin was what I needed to get my app to build properly with Svelte 5.Also updated tests to work for Svelte 5, as well as type errors in the plugin (due to changed imports and compiler options) and finally updated examples to show usage with Svelte 5 (since mounting a Svelte component will be a breaking change compared to Svelte 4).
fixes #232