Skip to content

Conversation

@oscar345
Copy link
Contributor

@oscar345 oscar345 commented Oct 4, 2025

The current implementation helps to get you going, but for Svelte more configuration is needed to make it work compared to React. Svelte needs to be compiled, unlike React and Vue. Therefore a plugin is needed to bundle Svelte files using esbuild. This can only be done by installing esbuild as a node package and using the JS interface. Adding plugins is not possible with the cli (evanw/esbuild#884).

This pull requests updates the igniter install for Svelte as client framework. Instead of using the cli, we use esbuild as a node package. This means mentions to the esbuild elixir dependency should be removed. So esbuild needs to be removed from the config, the list of dependencies and from the aliases for a mix project.

Besides removing code with the igniter install, igniter install should also add the following: a esbuild.config.js file, a node watchers to check for changes on the svelte files, aliases to install and build javascript code using node, a link tag in root template for the css file created by svelte and a altered tsconfig.json

I created a few tests when the --client-framework option is set to svelte.

PS: I disabled the following test: "creates tsconfig.json when typescript option is specified". By upgrading igniter to version 0.6 from 0.5 it seems that the test fails, also for the code currently present in version 2.5.1 of inertia-phoenix.

Oscar Zwagers added 4 commits October 4, 2025 20:33
compiled by the esbuild cli. It needs a plugin for esbuild.
Add comments clarifying Svelte CSS handling and esbuild changes. Remove
esbuild dependency and config, add node watcher, and update aliases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant