Update igniter install for svelte #61
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.jsfile, 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 alteredtsconfig.jsonI created a few tests when the
--client-frameworkoption is set tosvelte.PS: I disabled the following test:
"creates tsconfig.json when typescript option is specified". By upgrading igniter to version0.6from0.5it seems that the test fails, also for the code currently present in version2.5.1of inertia-phoenix.