Skip to content

Commit 2b3abcf

Browse files
justin808claude
andcommitted
Fix CSS dependency installation timing in generator
The generator was adding CSS dependencies to package.json but not installing them before RSpec tests could trigger webpack compilation. This caused "Cannot find module 'mini-css-extract-plugin'" errors when the test helper tried to compile assets. Added install_js_dependencies method that runs yarn install after adding dependencies, ensuring CSS loaders are available before any webpack compilation attempts during tests. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 67428aa commit 2b3abcf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/generators/react_on_rails/base_generator.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ def add_js_dependencies
235235
], type: :dev)
236236
end
237237

238+
def install_js_dependencies
239+
puts "Installing JavaScript dependencies"
240+
run "yarn install"
241+
end
242+
238243
def update_gitignore_for_auto_registration
239244
gitignore_path = File.join(destination_root, ".gitignore")
240245
return unless File.exist?(gitignore_path)

0 commit comments

Comments
 (0)