diff --git a/lib/generators/inertia/install/frameworks.yml b/lib/generators/inertia/install/frameworks.yml index 1fe2aeef..7fdde8cf 100644 --- a/lib/generators/inertia/install/frameworks.yml +++ b/lib/generators/inertia/install/frameworks.yml @@ -76,7 +76,6 @@ svelte: copy_files_js: "InertiaExample.svelte": "%{js_destination_path}/pages/inertia_example/index.svelte" copy_files: - "svelte.config.js": "svelte.config.js" "../assets/svelte.svg": "%{js_destination_path}/assets/svelte.svg" "../assets/inertia.svg": "%{js_destination_path}/assets/inertia.svg" "../assets/vite_ruby.svg": "%{js_destination_path}/assets/vite_ruby.svg" diff --git a/lib/generators/inertia/install/install_generator.rb b/lib/generators/inertia/install/install_generator.rb index 137e4ee3..9964719f 100644 --- a/lib/generators/inertia/install/install_generator.rb +++ b/lib/generators/inertia/install/install_generator.rb @@ -101,6 +101,12 @@ def install_inertia say "Copying #{inertia_entrypoint} entrypoint" copy_file "#{framework}/#{inertia_entrypoint}", js_file_path("entrypoints/#{inertia_entrypoint}") + # Copy framework-specific config files + if svelte? + say 'Copying svelte.config.js' + copy_file 'svelte/svelte.config.js', file_path('svelte.config.js') + end + say 'Copying InertiaController' copy_file 'inertia_controller.rb', file_path('app/controllers/inertia_controller.rb')